{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "from numpy import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "def loadSimpData():\n",
    "    datMat = matrix([[1., 2.1],\n",
    "                    [2., 1.1],\n",
    "                    [1.3, 1.],\n",
    "                    [1., 1.],\n",
    "                    [2., 1.]])\n",
    "    classLabels = [1.0, 1.0, -1.0, -1.0, 1.0]\n",
    "    return datMat, classLabels"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "datMat, classLabels = loadSimpData()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 通过阈值比较对数据进行分类\n",
    "# 所有在阈值一边的数据会分到类别 -1，而在另外一边的数据分到类别 +1\n",
    "# 参数：训练矩阵，特征下标，阈值，标记\n",
    "def stumpClassify(dataMatrix, dimen, threshVal, threshIneq):\n",
    "    retArray = ones((shape(dataMatrix)[0], 1))\n",
    "    if threshIneq == 'It':\n",
    "        retArray[dataMatrix[:, dimen] <= threshVal] = -1.0\n",
    "    else:\n",
    "        retArray[dataMatrix[:, dimen] > threshVal] = -1.0\n",
    "    return retArray\n",
    "\n",
    "def buildStump(dataArr, classLabels, D):\n",
    "    dataMatrix = mat(dataArr)\n",
    "    labelMat = mat(classLabels).T\n",
    "    m, n = shape(dataMatrix)\n",
    "    \n",
    "    numSteps = 10.0  # 特征属性的最大值（用于遍历每一个特征的所有可能值）\n",
    "    bestStump = {}\n",
    "    bestClasEst = mat(zeros((m, 1)))\n",
    "    minError = inf\n",
    "    for i in range(n):  # 遍历每一个特征\n",
    "        rangeMin = dataMatrix[:, i].min()  # 第i个特征的最小值\n",
    "        rangeMax = dataMatrix[:, i].max()  # 第i个特征的最大值\n",
    "        stepSize = (rangeMax - rangeMin) / numSteps  # 步长\n",
    "        for j in range(-1, int(numSteps)+1):  # 每个特征的可能值\n",
    "            for inequal in ['It', 'gt']:\n",
    "                threshVal = (rangeMin + float(j) * stepSize)\n",
    "                predictedVals = stumpClassify(dataMatrix, i, threshVal, inequal)\n",
    "                \n",
    "                errArr = mat(ones((m, 1)))\n",
    "                errArr[predictedVals == labelMat] = 0\n",
    "                weightedError = D.T * errArr\n",
    "                if weightedError < minError:\n",
    "                    minError = weightedError\n",
    "                    bestClasEst = predictedVals.copy()\n",
    "                    bestStump['dim'] = i\n",
    "                    bestStump['thresh'] = threshVal\n",
    "                    bestStump['ineq'] = inequal\n",
    "    return bestStump, minError, bestClasEst"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "matrix([[0.2],\n",
       "        [0.2],\n",
       "        [0.2],\n",
       "        [0.2],\n",
       "        [0.2]])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "D = mat(ones((5, 1)) / 5)  # 初始概率相等\n",
    "D"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "({'dim': 0, 'thresh': 1.3, 'ineq': 'It'}, matrix([[0.2]]), array([[-1.],\n",
       "        [ 1.],\n",
       "        [-1.],\n",
       "        [-1.],\n",
       "        [ 1.]]))"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "buildStump(datMat, classLabels, D)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 参数：数据集，类别标签，迭代次数\n",
    "def adaBoostTrainDS(dataArr, classLabels, numIt=40):\n",
    "    weakClassArr = []\n",
    "    m = shape(dataArr)[0]\n",
    "    D = mat(ones((m, 1)) / m)  # 初始概率相等\n",
    "    aggClassEst = mat(zeros((m, 1)))  # 记录每个数据点的类别估计累计值\n",
    "    for i in range(numIt):\n",
    "        bestStump, error, classEst = buildStump(dataArr, classLabels, D)\n",
    "        print('D: ', D.T)\n",
    "        \n",
    "        alpha = float(0.5 * log((1.0 - error) / max(error, 1e-16))) # 更新权重值\n",
    "        bestStump['alpha'] = alpha\n",
    "        \n",
    "        weakClassArr.append(bestStump)\n",
    "        print('classEst: ', classEst.T)\n",
    "        \n",
    "        # 更新概率\n",
    "        expon = multiply(-1 * alpha * mat(classLabels).T, classEst)\n",
    "        D = multiply(D, exp(expon))\n",
    "        D = D / D.sum()\n",
    "        \n",
    "        aggClassEst += alpha * classEst\n",
    "        print('aggClassEst: ', aggClassEst.T)\n",
    "        \n",
    "        # sign：正数返回1，负数返回-1，0返回0\n",
    "        # 最后乘以1是为了将布尔转换为数字，multiply是对应位置相乘\n",
    "        aggClassEst = multiply(sign(aggClassEst) != mat(classLabels).T, ones((m, 1)))\n",
    "        errorRate = aggClassEst.sum() / m\n",
    "        print('total error: ', errorRate)\n",
    "        \n",
    "        if errorRate == 0.0:\n",
    "            break\n",
    "    return weakClassArr"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:  [[0.2 0.2 0.2 0.2 0.2]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.69314718  0.69314718 -0.69314718 -0.69314718  0.69314718]]\n",
      "total error:  0.2\n",
      "D:  [[0.5   0.125 0.125 0.125 0.125]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.97295507  0.97295507 -0.97295507 -0.97295507 -0.97295507]]\n",
      "total error:  0.2\n",
      "D:  [[0.28571429 0.07142857 0.07142857 0.07142857 0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.89587973 0.89587973 0.89587973 0.89587973 1.89587973]]\n",
      "total error:  0.4\n",
      "D:  [[0.16666667 0.04166667 0.25       0.25       0.29166667]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.80471896  0.80471896  0.19528104  0.19528104  0.80471896]]\n",
      "total error:  0.6\n",
      "D:  [[0.5   0.025 0.15  0.15  0.175]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.77529871  0.77529871  0.22470129  0.22470129 -0.77529871]]\n",
      "total error:  0.6\n",
      "D:  [[0.3030303  0.01515152 0.09090909 0.09090909 0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.7520387 0.7520387 1.7520387 1.7520387 1.7520387]]\n",
      "total error:  0.4\n",
      "D:  [[0.18518519 0.00925926 0.25       0.25       0.30555556]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.74080227  0.74080227  0.25919773  0.25919773  0.74080227]]\n",
      "total error:  0.6\n",
      "D:  [[0.5        0.00568182 0.15340909 0.15340909 0.1875    ]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.73316853  0.73316853  0.26683147  0.26683147 -0.73316853]]\n",
      "total error:  0.6\n",
      "D:  [[0.30769231 0.0034965  0.09440559 0.09440559 0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.72887666 0.72887666 1.72887666 1.72887666 1.72887666]]\n",
      "total error:  0.4\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "[{'dim': 0, 'thresh': 1.3, 'ineq': 'It', 'alpha': 0.6931471805599453},\n",
       " {'dim': 1, 'thresh': 1.0, 'ineq': 'It', 'alpha': 0.9729550745276565},\n",
       " {'dim': 0, 'thresh': 0.9, 'ineq': 'It', 'alpha': 0.8958797346140273},\n",
       " {'dim': 0, 'thresh': 1.3, 'ineq': 'It', 'alpha': 0.8047189562170499},\n",
       " {'dim': 1, 'thresh': 1.0, 'ineq': 'It', 'alpha': 0.7752987062055835},\n",
       " {'dim': 0, 'thresh': 0.9, 'ineq': 'It', 'alpha': 0.752038698388137},\n",
       " {'dim': 0, 'thresh': 1.3, 'ineq': 'It', 'alpha': 0.7408022704621077},\n",
       " {'dim': 1, 'thresh': 1.0, 'ineq': 'It', 'alpha': 0.7331685343967135},\n",
       " {'dim': 0, 'thresh': 0.9, 'ineq': 'It', 'alpha': 0.7288766625510178}]"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "classifierArray = adaBoostTrainDS(datMat, classLabels, 9)\n",
    "classifierArray"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 测试"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 参数：多个待分类样例，多个弱分类器数组\n",
    "def adaClassify(datToClass, classifierArr):\n",
    "    dataMatrix = mat(datToClass)\n",
    "    m = shape(dataMatrix)[0]\n",
    "    aggClassEst = mat(zeros((m, 1)))\n",
    "    for i in range(len(classifierArr)):\n",
    "        classEst = stumpClassify(dataMatrix, classifierArr[i]['dim'],\n",
    "                                classifierArr[i]['thresh'],\n",
    "                                classifierArr[i]['ineq'])\n",
    "        aggClassEst += classifierArr[i]['alpha'] * classEst\n",
    "        print(aggClassEst)\n",
    "    return sign(aggClassEst)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:  [[0.2 0.2 0.2 0.2 0.2]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.69314718  0.69314718 -0.69314718 -0.69314718  0.69314718]]\n",
      "total error:  0.2\n",
      "D:  [[0.5   0.125 0.125 0.125 0.125]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.97295507  0.97295507 -0.97295507 -0.97295507 -0.97295507]]\n",
      "total error:  0.2\n",
      "D:  [[0.28571429 0.07142857 0.07142857 0.07142857 0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.89587973 0.89587973 0.89587973 0.89587973 1.89587973]]\n",
      "total error:  0.4\n",
      "D:  [[0.16666667 0.04166667 0.25       0.25       0.29166667]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.80471896  0.80471896  0.19528104  0.19528104  0.80471896]]\n",
      "total error:  0.6\n",
      "D:  [[0.5   0.025 0.15  0.15  0.175]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.77529871  0.77529871  0.22470129  0.22470129 -0.77529871]]\n",
      "total error:  0.6\n",
      "D:  [[0.3030303  0.01515152 0.09090909 0.09090909 0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.7520387 0.7520387 1.7520387 1.7520387 1.7520387]]\n",
      "total error:  0.4\n",
      "D:  [[0.18518519 0.00925926 0.25       0.25       0.30555556]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.74080227  0.74080227  0.25919773  0.25919773  0.74080227]]\n",
      "total error:  0.6\n",
      "D:  [[0.5        0.00568182 0.15340909 0.15340909 0.1875    ]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.73316853  0.73316853  0.26683147  0.26683147 -0.73316853]]\n",
      "total error:  0.6\n",
      "D:  [[0.30769231 0.0034965  0.09440559 0.09440559 0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.72887666 0.72887666 1.72887666 1.72887666 1.72887666]]\n",
      "total error:  0.4\n",
      "D:  [[0.18965517 0.00215517 0.25       0.25       0.30818966]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.72612616  0.72612616  0.27387384  0.27387384  0.72612616]]\n",
      "total error:  0.6\n",
      "D:  [[0.5        0.00132979 0.15425532 0.15425532 0.19015957]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.72448682  0.72448682  0.27551318  0.27551318 -0.72448682]]\n",
      "total error:  0.6\n",
      "D:  [[0.30870279 0.00082102 0.0952381  0.0952381  0.5       ]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.72345949 0.72345949 1.72345949 1.72345949 1.72345949]]\n",
      "total error:  0.4\n",
      "D:  [[0.19066937 0.0005071  0.25       0.25       0.30882353]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.72283332  0.72283332  0.27716668  0.27716668  0.72283332]]\n",
      "total error:  0.6\n",
      "D:  [[5.00000000e-01 3.13283208e-04 1.54448622e-01 1.54448622e-01\n",
      "  1.90789474e-01]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.72244426  0.72244426  0.27755574  0.27755574 -0.72244426]]\n",
      "total error:  0.6\n",
      "D:  [[3.08943089e-01 1.93573364e-04 9.54316686e-02 9.54316686e-02\n",
      "  5.00000000e-01]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.72220509 0.72220509 1.72220509 1.72220509 1.72220509]]\n",
      "total error:  0.4\n",
      "D:  [[1.90909091e-01 1.19617225e-04 2.50000000e-01 2.50000000e-01\n",
      "  3.08971292e-01]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.72205697  0.72205697  0.27794303  0.27794303  0.72205697]]\n",
      "total error:  0.6\n",
      "D:  [[5.00000000e-01 7.39207569e-05 1.54494382e-01 1.54494382e-01\n",
      "  1.90937315e-01]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.72196561  0.72196561  0.27803439  0.27803439 -0.72196561]]\n",
      "total error:  0.6\n",
      "D:  [[3.08999543e-01 4.56829603e-05 9.54773869e-02 9.54773869e-02\n",
      "  5.00000000e-01]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.7219091 0.7219091 1.7219091 1.7219091 1.7219091]]\n",
      "total error:  0.4\n",
      "D:  [[1.90965556e-01 2.82326369e-05 2.50000000e-01 2.50000000e-01\n",
      "  3.09006211e-01]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.72187421  0.72187421  0.27812579  0.27812579  0.72187421]]\n",
      "total error:  0.6\n",
      "D:  [[5.00000000e-01 1.74483529e-05 1.54505165e-01 1.54505165e-01\n",
      "  1.90972222e-01]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.72185263  0.72185263  0.27814737  0.27814737 -0.72185263]]\n",
      "total error:  0.6\n",
      "D:  [[3.09012876e-01 1.07835314e-05 9.54881705e-02 9.54881705e-02\n",
      "  5.00000000e-01]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.72183931 0.72183931 1.72183931 1.72183931 1.72183931]]\n",
      "total error:  0.4\n",
      "D:  [[1.90978887e-01 6.66453402e-06 2.50000000e-01 2.50000000e-01\n",
      "  3.09014449e-01]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.72183107  0.72183107  0.27816893  0.27816893  0.72183107]]\n",
      "total error:  0.6\n",
      "D:  [[5.00000000e-01 4.11888757e-06 1.54507711e-01 1.54507711e-01\n",
      "  1.90980460e-01]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.72182598  0.72182598  0.27817402  0.27817402 -0.72182598]]\n",
      "total error:  0.6\n",
      "D:  [[3.09016022e-01 2.54560450e-06 9.54907162e-02 9.54907162e-02\n",
      "  5.00000000e-01]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.72182283 0.72182283 1.72182283 1.72182283 1.72182283]]\n",
      "total error:  0.4\n",
      "D:  [[1.90982033e-01 1.57326705e-06 2.50000000e-01 2.50000000e-01\n",
      "  3.09016393e-01]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.72182088  0.72182088  0.27817912  0.27817912  0.72182088]]\n",
      "total error:  0.6\n",
      "D:  [[5.00000000e-01 9.72331339e-07 1.54508311e-01 1.54508311e-01\n",
      "  1.90982405e-01]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.72181968  0.72181968  0.27818032  0.27818032 -0.72181968]]\n",
      "total error:  0.6\n",
      "D:  [[3.09016765e-01 6.00933370e-07 9.54913171e-02 9.54913171e-02\n",
      "  5.00000000e-01]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.72181894 0.72181894 1.72181894 1.72181894 1.72181894]]\n",
      "total error:  0.4\n",
      "D:  [[1.90982776e-01 3.71397077e-07 2.50000000e-01 2.50000000e-01\n",
      "  3.09016853e-01]]\n",
      "classEst:  [[-1.  1. -1. -1.  1.]]\n",
      "aggClassEst:  [[-0.72181848  0.72181848  0.27818152  0.27818152  0.72181848]]\n",
      "total error:  0.6\n",
      "D:  [[5.00000000e-01 2.29535952e-07 1.54508453e-01 1.54508453e-01\n",
      "  1.90982864e-01]]\n",
      "classEst:  [[ 1.  1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 1.7218182  0.7218182  0.2781818  0.2781818 -0.7218182]]\n",
      "total error:  0.6\n",
      "D:  [[3.09016940e-01 1.41860995e-07 9.54914590e-02 9.54914590e-02\n",
      "  5.00000000e-01]]\n",
      "classEst:  [[1. 1. 1. 1. 1.]]\n",
      "aggClassEst:  [[0.72181802 0.72181802 1.72181802 1.72181802 1.72181802]]\n",
      "total error:  0.4\n",
      "[[-0.69314718]]\n",
      "[[-1.66610226]]\n",
      "[[-2.56198199]]\n",
      "[[-3.36670095]]\n",
      "[[-4.14199965]]\n",
      "[[-4.89403835]]\n",
      "[[-5.63484062]]\n",
      "[[-6.36800916]]\n",
      "[[-7.09688582]]\n",
      "[[-7.82301198]]\n",
      "[[-8.5474988]]\n",
      "[[-9.27095829]]\n",
      "[[-9.99379161]]\n",
      "[[-10.71623587]]\n",
      "[[-11.43844096]]\n",
      "[[-12.16049792]]\n",
      "[[-12.88246353]]\n",
      "[[-13.60437264]]\n",
      "[[-14.32624684]]\n",
      "[[-15.04809948]]\n",
      "[[-15.76993878]]\n",
      "[[-16.49176985]]\n",
      "[[-17.21359582]]\n",
      "[[-17.93541865]]\n",
      "[[-18.65723954]]\n",
      "[[-19.37905922]]\n",
      "[[-20.10087816]]\n",
      "[[-20.82269664]]\n",
      "[[-21.54451484]]\n",
      "[[-22.26633286]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "matrix([[-1.]])"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datArr, labelArr = loadSimpData()\n",
    "classifierArr = adaBoostTrainDS(datArr, labelArr, 30)\n",
    "adaClassify([0, 0], classifierArr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0.69314718]\n",
      " [-0.69314718]]\n",
      "[[ 1.66610226]\n",
      " [-1.66610226]]\n",
      "[[ 2.56198199]\n",
      " [-2.56198199]]\n",
      "[[ 3.36670095]\n",
      " [-3.36670095]]\n",
      "[[ 4.14199965]\n",
      " [-4.14199965]]\n",
      "[[ 4.89403835]\n",
      " [-4.89403835]]\n",
      "[[ 5.63484062]\n",
      " [-5.63484062]]\n",
      "[[ 6.36800916]\n",
      " [-6.36800916]]\n",
      "[[ 7.09688582]\n",
      " [-7.09688582]]\n",
      "[[ 7.82301198]\n",
      " [-7.82301198]]\n",
      "[[ 8.5474988]\n",
      " [-8.5474988]]\n",
      "[[ 9.27095829]\n",
      " [-9.27095829]]\n",
      "[[ 9.99379161]\n",
      " [-9.99379161]]\n",
      "[[ 10.71623587]\n",
      " [-10.71623587]]\n",
      "[[ 11.43844096]\n",
      " [-11.43844096]]\n",
      "[[ 12.16049792]\n",
      " [-12.16049792]]\n",
      "[[ 12.88246353]\n",
      " [-12.88246353]]\n",
      "[[ 13.60437264]\n",
      " [-13.60437264]]\n",
      "[[ 14.32624684]\n",
      " [-14.32624684]]\n",
      "[[ 15.04809948]\n",
      " [-15.04809948]]\n",
      "[[ 15.76993878]\n",
      " [-15.76993878]]\n",
      "[[ 16.49176985]\n",
      " [-16.49176985]]\n",
      "[[ 17.21359582]\n",
      " [-17.21359582]]\n",
      "[[ 17.93541865]\n",
      " [-17.93541865]]\n",
      "[[ 18.65723954]\n",
      " [-18.65723954]]\n",
      "[[ 19.37905922]\n",
      " [-19.37905922]]\n",
      "[[ 20.10087816]\n",
      " [-20.10087816]]\n",
      "[[ 20.82269664]\n",
      " [-20.82269664]]\n",
      "[[ 21.54451484]\n",
      " [-21.54451484]]\n",
      "[[ 22.26633286]\n",
      " [-22.26633286]]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "matrix([[ 1.],\n",
       "        [-1.]])"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "adaClassify([[5, 5], [0, 0]], classifierArr)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 预测患有疝病的马能否存活"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [],
   "source": [
    "def loadDataSet(fileName):\n",
    "    numFeat = len(open(fileName).readline().split('\\t'))\n",
    "    dataMat = []\n",
    "    labelMat = []\n",
    "    fr = open(fileName)\n",
    "    for line in fr.readlines():\n",
    "        lineArr = []\n",
    "        curLine = line.strip().split('\\t')\n",
    "        for i in range(numFeat - 1):\n",
    "            lineArr.append(float(curLine[i]))\n",
    "        dataMat.append(lineArr)\n",
    "        labelMat.append(float(curLine[-1]))\n",
    "    return dataMat, labelMat"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:  [[0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448 0.00334448\n",
      "  0.00334448 0.00334448 0.00334448 0.00334448 0.00334448]]\n",
      "classEst:  [[-1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1. -1.\n",
      "   1. -1.  1.  1. -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1. -1.  1. -1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1. -1. -1.\n",
      "   1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1.  1.  1.  1.  1.\n",
      "  -1. -1. -1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1. -1. -1.  1.  1.]]\n",
      "aggClassEst:  [[-0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238 -0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238 -0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238  0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "  -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "  -0.46166238 -0.46166238 -0.46166238  0.46166238 -0.46166238 -0.46166238\n",
      "   0.46166238  0.46166238  0.46166238  0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238  0.46166238  0.46166238 -0.46166238  0.46166238  0.46166238\n",
      "   0.46166238 -0.46166238 -0.46166238  0.46166238  0.46166238]]\n",
      "total error:  0.2842809364548495\n",
      "D:  [[0.00233645 0.00588235 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00588235 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00588235 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00233645 0.00588235 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00588235 0.00233645 0.00233645 0.00588235\n",
      "  0.00588235 0.00233645 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00588235 0.00588235 0.00233645 0.00588235 0.00588235\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00233645 0.00588235\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00588235 0.00233645 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00588235\n",
      "  0.00233645 0.00588235 0.00588235 0.00588235 0.00233645 0.00588235\n",
      "  0.00588235 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00588235\n",
      "  0.00233645 0.00588235 0.00233645 0.00588235 0.00588235 0.00588235\n",
      "  0.00588235 0.00588235 0.00233645 0.00588235 0.00588235 0.00233645\n",
      "  0.00588235 0.00588235 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00588235 0.00233645 0.00233645 0.00233645 0.00233645 0.00588235\n",
      "  0.00588235 0.00588235 0.00233645 0.00588235 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00588235 0.00588235\n",
      "  0.00233645 0.00233645 0.00233645 0.00233645 0.00233645 0.00233645\n",
      "  0.00233645 0.00233645 0.00588235 0.00233645 0.00588235 0.00233645\n",
      "  0.00588235 0.00233645 0.00233645 0.00233645 0.00588235]]\n",
      "classEst:  [[ 1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.\n",
      "   1. -1.  1.  1. -1.  1.  1.  1. -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.\n",
      "  -1.  1.  1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.  1.  1.  1.\n",
      "   1. -1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1. -1. -1.  1. -1.\n",
      "   1.  1.  1. -1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1.  1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1. -1.  1.  1.  1. -1.  1. -1.  1.  1.]]\n",
      "aggClassEst:  [[ 0.31248245  1.31248245  0.31248245  1.31248245  0.68751755  0.31248245\n",
      "   0.31248245  1.31248245  0.31248245  1.31248245  0.31248245  0.31248245\n",
      "   0.31248245  1.31248245  0.31248245  0.31248245 -0.31248245  0.31248245\n",
      "   0.31248245 -0.31248245  1.31248245  0.31248245  0.31248245  0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  0.31248245  1.31248245  0.31248245\n",
      "  -0.31248245  1.31248245  0.31248245  0.31248245  1.31248245 -0.31248245\n",
      "   1.31248245  0.68751755  0.31248245  1.31248245 -0.31248245  0.31248245\n",
      "   0.31248245  0.31248245 -0.31248245 -0.31248245  0.68751755  0.31248245\n",
      "   0.68751755 -0.31248245  0.31248245  1.31248245  0.31248245  0.31248245\n",
      "   0.68751755  1.31248245  0.31248245  0.31248245 -0.31248245 -0.31248245\n",
      "   0.31248245  0.31248245  0.68751755  0.68751755  0.31248245  0.31248245\n",
      "  -0.31248245  0.31248245 -0.31248245  0.31248245  1.31248245  0.31248245\n",
      "   1.31248245 -0.31248245  1.31248245  1.31248245  0.31248245  0.31248245\n",
      "   0.31248245 -0.31248245  0.31248245  0.31248245  0.31248245 -0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  1.31248245  0.31248245  0.31248245\n",
      "  -0.31248245  0.68751755  0.31248245  0.31248245  0.31248245  0.31248245\n",
      "   0.31248245  0.68751755  0.31248245 -0.31248245  0.31248245  0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  0.31248245  0.31248245  0.31248245\n",
      "  -0.31248245  1.31248245  0.68751755  0.31248245  0.31248245  1.31248245\n",
      "   1.31248245  0.31248245  0.31248245  1.31248245  1.31248245  0.31248245\n",
      "   0.31248245 -0.31248245  0.31248245  0.31248245  1.31248245  0.31248245\n",
      "   1.31248245  1.31248245  1.31248245  0.31248245  1.31248245  1.31248245\n",
      "   0.31248245 -0.31248245  0.31248245  0.31248245  0.31248245  0.31248245\n",
      "   0.31248245  0.31248245  0.68751755 -0.31248245  0.31248245  0.68751755\n",
      "   0.31248245  0.31248245  1.31248245 -0.31248245  0.31248245  0.31248245\n",
      "  -0.31248245 -0.31248245  0.31248245  0.31248245  0.31248245  0.31248245\n",
      "   1.31248245  0.31248245  0.31248245  1.31248245  1.31248245  0.31248245\n",
      "   0.31248245  0.31248245  0.68751755  0.31248245  0.31248245 -0.31248245\n",
      "   0.31248245  0.31248245  0.68751755 -0.31248245  0.68751755  0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  1.31248245  0.31248245  0.31248245\n",
      "   0.31248245 -0.31248245  0.31248245  0.31248245 -0.31248245  0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  0.31248245  1.31248245  0.31248245\n",
      "  -0.31248245  0.31248245  0.31248245  0.68751755  0.68751755  0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  1.31248245  0.31248245  1.31248245\n",
      "   0.31248245  1.31248245  1.31248245  0.68751755  0.31248245  1.31248245\n",
      "   1.31248245  0.31248245  0.31248245  0.31248245  0.31248245  0.31248245\n",
      "  -0.31248245  1.31248245  0.31248245  0.31248245  0.31248245 -0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  0.68751755  0.31248245 -0.31248245\n",
      "   0.31248245  1.31248245 -0.31248245  0.31248245  0.31248245  0.31248245\n",
      "  -0.31248245  0.31248245  0.31248245  1.31248245  0.31248245 -0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  0.31248245 -0.31248245  1.31248245\n",
      "   0.31248245  1.31248245  0.31248245  0.68751755  1.31248245  1.31248245\n",
      "   1.31248245  1.31248245  0.31248245  1.31248245  0.68751755  0.31248245\n",
      "   0.68751755  1.31248245  0.31248245  0.31248245  0.31248245  0.31248245\n",
      "   1.31248245  0.31248245  0.31248245  0.31248245  0.31248245  1.31248245\n",
      "   1.31248245  1.31248245 -0.31248245  1.31248245  0.31248245  0.31248245\n",
      "   0.31248245  0.31248245  0.31248245  0.31248245  0.68751755  0.68751755\n",
      "   0.31248245  0.31248245  0.31248245  0.31248245  0.31248245  0.31248245\n",
      "   0.31248245  0.31248245  0.68751755  0.31248245  1.31248245  0.31248245\n",
      "   0.68751755  0.31248245 -0.31248245  0.31248245  1.31248245]]\n",
      "total error:  0.36454849498327757\n",
      "D:  [[0.00335068 0.00843582 0.00179355 0.00843582 0.00451553 0.00179355\n",
      "  0.00179355 0.00843582 0.00335068 0.00451553 0.00179355 0.00179355\n",
      "  0.00179355 0.00843582 0.00179355 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00335068 0.00451553 0.00179355 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00179355 0.00843582 0.00179355\n",
      "  0.00179355 0.00843582 0.00179355 0.00179355 0.00451553 0.00179355\n",
      "  0.00843582 0.00843582 0.00179355 0.00843582 0.00179355 0.00179355\n",
      "  0.00179355 0.00335068 0.00179355 0.00179355 0.00843582 0.00179355\n",
      "  0.00451553 0.00179355 0.00179355 0.00843582 0.00179355 0.00179355\n",
      "  0.00451553 0.00843582 0.00179355 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00451553 0.00451553 0.00179355 0.00179355\n",
      "  0.00335068 0.00179355 0.00335068 0.00179355 0.00843582 0.00179355\n",
      "  0.00843582 0.00179355 0.00843582 0.00843582 0.00179355 0.00179355\n",
      "  0.00335068 0.00335068 0.00335068 0.00179355 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00335068 0.00843582 0.00179355 0.00179355\n",
      "  0.00335068 0.00451553 0.00179355 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00451553 0.00179355 0.00335068 0.00179355 0.00335068\n",
      "  0.00179355 0.00179355 0.00335068 0.00179355 0.00179355 0.00179355\n",
      "  0.00179355 0.00843582 0.00451553 0.00179355 0.00179355 0.00843582\n",
      "  0.00451553 0.00179355 0.00179355 0.00843582 0.00451553 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00335068 0.00843582 0.00179355\n",
      "  0.00451553 0.00451553 0.00843582 0.00179355 0.00843582 0.00843582\n",
      "  0.00179355 0.00179355 0.00335068 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00451553 0.00179355 0.00179355 0.00451553\n",
      "  0.00179355 0.00179355 0.00843582 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00335068 0.00179355 0.00179355 0.00179355 0.00179355\n",
      "  0.00843582 0.00179355 0.00179355 0.00451553 0.00843582 0.00179355\n",
      "  0.00335068 0.00179355 0.00451553 0.00179355 0.00179355 0.00335068\n",
      "  0.00335068 0.00179355 0.00451553 0.00335068 0.00451553 0.00335068\n",
      "  0.00179355 0.00179355 0.00335068 0.00451553 0.00335068 0.00335068\n",
      "  0.00179355 0.00179355 0.00179355 0.00179355 0.00335068 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00179355 0.00451553 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00451553 0.00451553 0.00179355\n",
      "  0.00179355 0.00179355 0.00335068 0.00843582 0.00179355 0.00451553\n",
      "  0.00335068 0.00451553 0.00843582 0.00451553 0.00179355 0.00843582\n",
      "  0.00843582 0.00179355 0.00179355 0.00179355 0.00179355 0.00179355\n",
      "  0.00335068 0.00843582 0.00179355 0.00335068 0.00179355 0.00335068\n",
      "  0.00179355 0.00179355 0.00179355 0.00451553 0.00179355 0.00179355\n",
      "  0.00179355 0.00451553 0.00179355 0.00179355 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00179355 0.00843582 0.00335068 0.00179355\n",
      "  0.00179355 0.00335068 0.00179355 0.00179355 0.00179355 0.00451553\n",
      "  0.00335068 0.00451553 0.00179355 0.00451553 0.00843582 0.00843582\n",
      "  0.00451553 0.00451553 0.00335068 0.00843582 0.00451553 0.00179355\n",
      "  0.00451553 0.00451553 0.00179355 0.00179355 0.00335068 0.00179355\n",
      "  0.00843582 0.00179355 0.00179355 0.00179355 0.00179355 0.00843582\n",
      "  0.00451553 0.00451553 0.00179355 0.00843582 0.00335068 0.00335068\n",
      "  0.00179355 0.00179355 0.00179355 0.00179355 0.00451553 0.00451553\n",
      "  0.00179355 0.00179355 0.00179355 0.00335068 0.00179355 0.00179355\n",
      "  0.00179355 0.00179355 0.00451553 0.00335068 0.00843582 0.00179355\n",
      "  0.00451553 0.00335068 0.00179355 0.00179355 0.00843582]]\n",
      "classEst:  [[-1. -1.  1. -1. -1.  1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1.\n",
      "  -1. -1. -1.  1.  1. -1. -1. -1. -1.  1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1.  1.  1.\n",
      "  -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1. -1.  1.\n",
      "  -1.  1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1. -1.  1.  1.\n",
      "   1.  1. -1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.\n",
      "  -1.  1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.\n",
      "  -1. -1. -1.  1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1.\n",
      "   1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1. -1.  1. -1. -1. -1.\n",
      "  -1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1.  1.\n",
      "  -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1.  1. -1.  1.\n",
      "   1.  1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.\n",
      "  -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1.  1. -1. -1.  1.  1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1.  1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[ 0.71319027  0.71319027  0.28680973  0.71319027  0.71319027  0.28680973\n",
      "   0.28680973  0.71319027  0.71319027 -0.28680973 -0.28680973 -0.28680973\n",
      "   0.28680973  0.71319027 -0.28680973  0.71319027 -0.28680973  0.28680973\n",
      "  -0.28680973  0.71319027 -0.28680973  0.28680973  0.28680973 -0.28680973\n",
      "  -0.28680973 -0.28680973 -0.28680973  0.28680973  1.28680973  0.28680973\n",
      "  -0.28680973  0.71319027 -0.28680973 -0.28680973 -0.28680973 -0.28680973\n",
      "   0.71319027 -0.28680973  0.28680973  0.71319027 -0.28680973 -0.28680973\n",
      "  -0.28680973  0.71319027 -0.28680973 -0.28680973 -0.28680973  0.28680973\n",
      "   0.71319027 -0.28680973  0.28680973  0.71319027  0.28680973  0.28680973\n",
      "   0.71319027  0.71319027  0.28680973  0.71319027  0.28680973 -0.28680973\n",
      "   0.28680973 -0.28680973  0.71319027  0.71319027 -0.28680973 -0.28680973\n",
      "   0.71319027  0.28680973  1.28680973  0.28680973  0.71319027  0.28680973\n",
      "   0.71319027  0.28680973  1.28680973  0.71319027  0.28680973  0.28680973\n",
      "   1.28680973  0.71319027  0.71319027  0.28680973 -0.28680973  0.28680973\n",
      "  -0.28680973  0.28680973  0.71319027  1.28680973 -0.28680973  0.28680973\n",
      "   1.28680973  0.71319027  0.28680973  1.28680973  0.28680973  0.28680973\n",
      "  -0.28680973  0.71319027  0.28680973  0.71319027  0.28680973  0.71319027\n",
      "   0.28680973 -0.28680973  1.28680973 -0.28680973  0.28680973  0.28680973\n",
      "  -0.28680973  0.71319027  0.71319027  0.28680973  0.28680973  0.71319027\n",
      "   0.28680973  0.28680973  0.28680973  1.28680973 -0.28680973 -0.28680973\n",
      "   0.28680973 -0.28680973  0.28680973  0.71319027  1.28680973  0.28680973\n",
      "   0.28680973  0.28680973  0.71319027  0.28680973  1.28680973  0.71319027\n",
      "   0.28680973 -0.28680973  0.71319027  1.28680973  0.28680973 -0.28680973\n",
      "  -0.28680973  0.28680973  1.28680973 -0.28680973  0.28680973  0.71319027\n",
      "  -0.28680973  0.28680973  1.28680973  0.71319027  0.28680973  0.28680973\n",
      "   0.28680973  0.71319027  0.28680973  0.28680973  0.28680973  0.28680973\n",
      "   0.71319027  0.28680973  0.28680973  0.28680973  1.28680973 -0.28680973\n",
      "   0.71319027 -0.28680973  0.71319027  0.28680973  0.28680973  0.71319027\n",
      "   0.71319027  0.28680973  0.71319027  0.71319027  0.71319027  1.28680973\n",
      "   0.28680973 -0.28680973  0.71319027 -0.28680973  0.71319027  0.71319027\n",
      "   0.28680973  0.28680973 -0.28680973 -0.28680973  0.71319027 -0.28680973\n",
      "  -0.28680973 -0.28680973 -0.28680973  0.28680973 -0.28680973  0.28680973\n",
      "  -0.28680973 -0.28680973  0.28680973  0.71319027  0.71319027 -0.28680973\n",
      "  -0.28680973  0.28680973  0.71319027  1.28680973  0.28680973  0.28680973\n",
      "   0.71319027 -0.28680973  1.28680973  0.71319027  0.28680973  0.71319027\n",
      "   0.71319027 -0.28680973  0.28680973 -0.28680973  0.28680973  0.28680973\n",
      "   0.71319027  1.28680973  0.28680973  0.71319027 -0.28680973  0.71319027\n",
      "  -0.28680973  0.28680973  0.28680973  0.71319027  0.28680973 -0.28680973\n",
      "  -0.28680973 -0.28680973 -0.28680973  0.28680973 -0.28680973  0.28680973\n",
      "   0.28680973  0.28680973  0.28680973  0.71319027  0.71319027 -0.28680973\n",
      "   0.28680973  1.28680973 -0.28680973 -0.28680973 -0.28680973 -0.28680973\n",
      "   0.71319027 -0.28680973  0.28680973  0.71319027  1.28680973  0.71319027\n",
      "  -0.28680973 -0.28680973  0.71319027  0.71319027  0.71319027  0.28680973\n",
      "   0.71319027  0.28680973  0.28680973 -0.28680973  0.71319027  0.28680973\n",
      "   0.71319027 -0.28680973  0.28680973  0.28680973 -0.28680973  0.71319027\n",
      "  -0.28680973 -0.28680973 -0.28680973  0.71319027  0.71319027  1.28680973\n",
      "   0.28680973  0.28680973 -0.28680973  0.28680973  0.71319027  0.71319027\n",
      "  -0.28680973  0.28680973 -0.28680973  0.71319027 -0.28680973  0.28680973\n",
      "   0.28680973  0.28680973  0.71319027  0.71319027  0.71319027  0.28680973\n",
      "   0.71319027  0.71319027 -0.28680973 -0.28680973  1.28680973]]\n",
      "total error:  0.5719063545150501\n",
      "D:  [[0.00261936 0.00659463 0.00140209 0.00659463 0.00352998 0.00140209\n",
      "  0.00140209 0.00659463 0.00261936 0.00626457 0.00248826 0.00248826\n",
      "  0.00140209 0.00659463 0.00248826 0.00261936 0.00140209 0.00140209\n",
      "  0.00248826 0.00464853 0.00626457 0.00140209 0.00140209 0.00248826\n",
      "  0.00248826 0.00248826 0.00248826 0.00140209 0.01170335 0.00140209\n",
      "  0.00140209 0.00659463 0.00248826 0.00248826 0.00626457 0.00140209\n",
      "  0.00659463 0.01170335 0.00140209 0.00659463 0.00140209 0.00248826\n",
      "  0.00248826 0.00261936 0.00140209 0.00140209 0.01170335 0.00140209\n",
      "  0.00352998 0.00140209 0.00140209 0.00659463 0.00140209 0.00140209\n",
      "  0.00352998 0.00659463 0.00140209 0.00261936 0.00248826 0.00140209\n",
      "  0.00140209 0.00248826 0.00352998 0.00352998 0.00248826 0.00248826\n",
      "  0.00464853 0.00140209 0.00261936 0.00140209 0.00659463 0.00140209\n",
      "  0.00659463 0.00248826 0.01170335 0.00659463 0.00140209 0.00140209\n",
      "  0.00464853 0.00464853 0.00261936 0.00140209 0.00248826 0.00248826\n",
      "  0.00248826 0.00140209 0.00261936 0.01170335 0.00248826 0.00140209\n",
      "  0.00261936 0.00352998 0.00140209 0.00464853 0.00140209 0.00140209\n",
      "  0.00248826 0.00352998 0.00140209 0.00464853 0.00140209 0.00261936\n",
      "  0.00140209 0.00248826 0.00464853 0.00248826 0.00140209 0.00140209\n",
      "  0.00140209 0.00659463 0.00352998 0.00140209 0.00140209 0.00659463\n",
      "  0.00352998 0.00140209 0.00140209 0.01170335 0.00626457 0.00248826\n",
      "  0.00140209 0.00140209 0.00140209 0.00261936 0.01170335 0.00140209\n",
      "  0.00352998 0.00352998 0.00659463 0.00140209 0.01170335 0.00659463\n",
      "  0.00140209 0.00140209 0.00261936 0.00464853 0.00140209 0.00248826\n",
      "  0.00248826 0.00140209 0.00626457 0.00140209 0.00140209 0.00352998\n",
      "  0.00248826 0.00140209 0.01170335 0.00464853 0.00140209 0.00140209\n",
      "  0.00248826 0.00464853 0.00140209 0.00140209 0.00140209 0.00140209\n",
      "  0.00659463 0.00140209 0.00140209 0.00352998 0.01170335 0.00248826\n",
      "  0.00261936 0.00248826 0.00352998 0.00140209 0.00140209 0.00464853\n",
      "  0.00261936 0.00140209 0.00352998 0.00464853 0.00352998 0.00464853\n",
      "  0.00140209 0.00248826 0.00261936 0.00626457 0.00261936 0.00261936\n",
      "  0.00140209 0.00248826 0.00248826 0.00248826 0.00464853 0.00248826\n",
      "  0.00248826 0.00248826 0.00248826 0.00140209 0.00626457 0.00140209\n",
      "  0.00140209 0.00248826 0.00140209 0.00352998 0.00352998 0.00248826\n",
      "  0.00248826 0.00140209 0.00261936 0.01170335 0.00140209 0.00352998\n",
      "  0.00261936 0.00626457 0.01170335 0.00352998 0.00140209 0.00659463\n",
      "  0.00659463 0.00248826 0.00140209 0.00248826 0.00140209 0.00140209\n",
      "  0.00464853 0.01170335 0.00140209 0.00261936 0.00248826 0.00464853\n",
      "  0.00248826 0.00140209 0.00140209 0.00352998 0.00140209 0.00140209\n",
      "  0.00248826 0.00626457 0.00140209 0.00140209 0.00248826 0.00140209\n",
      "  0.00248826 0.00140209 0.00140209 0.00659463 0.00261936 0.00140209\n",
      "  0.00140209 0.00464853 0.00248826 0.00248826 0.00140209 0.00626457\n",
      "  0.00261936 0.00626457 0.00140209 0.00352998 0.01170335 0.00659463\n",
      "  0.00626457 0.00626457 0.00261936 0.00659463 0.00352998 0.00140209\n",
      "  0.00352998 0.00352998 0.00140209 0.00248826 0.00261936 0.00140209\n",
      "  0.00659463 0.00248826 0.00140209 0.00140209 0.00248826 0.00659463\n",
      "  0.00626457 0.00626457 0.00140209 0.00659463 0.00261936 0.00464853\n",
      "  0.00140209 0.00140209 0.00248826 0.00140209 0.00352998 0.00352998\n",
      "  0.00248826 0.00140209 0.00248826 0.00261936 0.00248826 0.00140209\n",
      "  0.00140209 0.00140209 0.00352998 0.00261936 0.00659463 0.00140209\n",
      "  0.00352998 0.00261936 0.00140209 0.00248826 0.01170335]]\n",
      "classEst:  [[-1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1.  1. -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1. -1.  1.  1.  1. -1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1.  1.  1. -1.  1. -1.  1. -1. -1.  1. -1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.\n",
      "  -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1. -1.  1.\n",
      "  -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1.  1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1. -1. -1. -1.]]\n",
      "aggClassEst:  [[ 0.76702995  1.23297005 -0.23297005  0.76702995  0.76702995 -0.23297005\n",
      "  -0.23297005  0.76702995  0.76702995  0.76702995  0.76702995  0.76702995\n",
      "  -0.23297005  0.76702995  1.23297005  0.76702995 -0.23297005 -0.23297005\n",
      "   0.76702995 -0.23297005  0.76702995 -0.23297005 -0.23297005  1.23297005\n",
      "   1.23297005  0.76702995  0.76702995 -0.23297005  0.76702995  0.23297005\n",
      "  -0.23297005  0.76702995  0.76702995  0.76702995  0.76702995 -0.23297005\n",
      "   0.76702995  1.23297005 -0.23297005  0.76702995 -0.23297005  0.76702995\n",
      "   0.76702995  1.23297005  0.23297005 -0.23297005  0.76702995 -0.23297005\n",
      "   0.76702995 -0.23297005 -0.23297005  0.76702995 -0.23297005 -0.23297005\n",
      "   0.76702995  0.76702995 -0.23297005  0.76702995  0.76702995 -0.23297005\n",
      "  -0.23297005  0.76702995  0.76702995  1.23297005  0.76702995  1.23297005\n",
      "   0.23297005 -0.23297005 -0.23297005 -0.23297005  0.76702995 -0.23297005\n",
      "   0.76702995  0.76702995  0.76702995  0.76702995  0.23297005  0.23297005\n",
      "   0.76702995 -0.23297005  0.76702995 -0.23297005  0.76702995  0.76702995\n",
      "   0.76702995 -0.23297005  0.76702995  0.76702995  0.76702995 -0.23297005\n",
      "   0.23297005  0.76702995 -0.23297005  0.76702995 -0.23297005  0.23297005\n",
      "   0.76702995  0.76702995 -0.23297005 -0.23297005  0.23297005  0.76702995\n",
      "  -0.23297005  0.76702995  0.76702995  0.76702995 -0.23297005 -0.23297005\n",
      "   0.23297005  0.76702995  0.76702995 -0.23297005 -0.23297005  0.76702995\n",
      "   0.23297005  0.23297005  0.23297005  0.76702995  1.23297005  1.23297005\n",
      "  -0.23297005 -0.23297005 -0.23297005  0.76702995  0.76702995 -0.23297005\n",
      "  -0.23297005 -0.23297005  0.76702995 -0.23297005  0.76702995  0.76702995\n",
      "  -0.23297005 -0.23297005  0.76702995  0.76702995 -0.23297005  1.23297005\n",
      "   0.76702995 -0.23297005  0.76702995 -0.23297005 -0.23297005  1.23297005\n",
      "   1.23297005  0.23297005  0.76702995 -0.23297005  0.23297005  0.23297005\n",
      "   0.76702995  0.23297005 -0.23297005  0.23297005 -0.23297005 -0.23297005\n",
      "   1.23297005 -0.23297005 -0.23297005 -0.23297005  0.76702995  0.76702995\n",
      "   0.76702995  0.76702995  1.23297005 -0.23297005 -0.23297005 -0.23297005\n",
      "   0.76702995 -0.23297005  0.76702995  0.23297005  0.76702995  0.76702995\n",
      "  -0.23297005  1.23297005  0.76702995  1.23297005  0.76702995  0.76702995\n",
      "  -0.23297005  0.76702995  1.23297005  1.23297005 -0.23297005  0.76702995\n",
      "   0.76702995  0.76702995  0.76702995 -0.23297005  0.76702995  0.23297005\n",
      "  -0.23297005  0.76702995  0.23297005  0.76702995  0.76702995  1.23297005\n",
      "   0.76702995 -0.23297005  0.76702995  0.76702995 -0.23297005 -0.23297005\n",
      "   0.76702995  1.23297005  0.76702995  1.23297005 -0.23297005  0.76702995\n",
      "   0.76702995  0.76702995 -0.23297005  0.76702995 -0.23297005 -0.23297005\n",
      "  -0.23297005  0.76702995 -0.23297005  0.76702995  1.23297005 -0.23297005\n",
      "   0.76702995 -0.23297005 -0.23297005  0.76702995 -0.23297005 -0.23297005\n",
      "   0.76702995  0.76702995 -0.23297005 -0.23297005  0.76702995 -0.23297005\n",
      "   0.76702995 -0.23297005 -0.23297005  0.76702995  1.23297005 -0.23297005\n",
      "  -0.23297005  0.76702995  0.76702995  0.76702995 -0.23297005  0.76702995\n",
      "   0.76702995  0.76702995 -0.23297005  0.76702995  0.76702995  0.76702995\n",
      "   0.76702995  1.23297005  0.76702995  1.23297005  0.76702995 -0.23297005\n",
      "   0.76702995  0.23297005 -0.23297005  0.76702995  0.76702995 -0.23297005\n",
      "   0.76702995  0.76702995 -0.23297005 -0.23297005  0.76702995  0.76702995\n",
      "   0.76702995  0.76702995 -0.23297005  0.76702995  0.76702995  1.23297005\n",
      "  -0.23297005 -0.23297005  0.76702995  0.23297005  0.76702995  0.76702995\n",
      "   0.76702995 -0.23297005  0.76702995  0.76702995  0.76702995 -0.23297005\n",
      "  -0.23297005 -0.23297005  0.76702995  0.76702995  0.76702995  0.23297005\n",
      "   1.23297005  0.76702995 -0.23297005  0.76702995  0.76702995]]\n",
      "total error:  0.6421404682274248\n",
      "D:  [[0.00213157 0.00855163 0.00181817 0.00536653 0.0028726  0.00181817\n",
      "  0.00181817 0.00536653 0.00213157 0.00812362 0.00322667 0.00322667\n",
      "  0.00181817 0.00536653 0.00202488 0.00213157 0.00114098 0.00181817\n",
      "  0.00322667 0.00602801 0.00812362 0.00181817 0.00181817 0.00202488\n",
      "  0.00202488 0.00322667 0.00322667 0.00181817 0.00952387 0.00114098\n",
      "  0.00114098 0.00536653 0.00322667 0.00322667 0.00812362 0.00114098\n",
      "  0.00536653 0.00952387 0.00181817 0.00536653 0.00114098 0.00322667\n",
      "  0.00322667 0.00339667 0.00181817 0.00114098 0.01517639 0.00181817\n",
      "  0.0028726  0.00114098 0.00181817 0.00536653 0.00181817 0.00181817\n",
      "  0.0028726  0.00536653 0.00181817 0.00213157 0.00202488 0.00114098\n",
      "  0.00181817 0.00322667 0.0028726  0.00457752 0.00322667 0.00202488\n",
      "  0.00378284 0.00181817 0.00339667 0.00181817 0.00536653 0.00181817\n",
      "  0.00536653 0.00202488 0.00952387 0.00536653 0.00114098 0.00114098\n",
      "  0.00378284 0.00602801 0.00213157 0.00181817 0.00322667 0.00202488\n",
      "  0.00322667 0.00181817 0.00213157 0.00952387 0.00322667 0.00181817\n",
      "  0.00213157 0.0028726  0.00181817 0.00378284 0.00181817 0.00114098\n",
      "  0.00322667 0.0028726  0.00181817 0.00602801 0.00114098 0.00213157\n",
      "  0.00181817 0.00322667 0.00378284 0.00322667 0.00181817 0.00181817\n",
      "  0.00181817 0.00536653 0.0028726  0.00181817 0.00181817 0.00536653\n",
      "  0.0028726  0.00114098 0.00114098 0.00952387 0.00509794 0.00202488\n",
      "  0.00181817 0.00114098 0.00181817 0.00213157 0.00952387 0.00181817\n",
      "  0.00457752 0.00457752 0.00536653 0.00181817 0.00952387 0.00536653\n",
      "  0.00181817 0.00114098 0.00213157 0.00378284 0.00181817 0.00202488\n",
      "  0.00322667 0.00181817 0.00509794 0.00114098 0.00181817 0.00457752\n",
      "  0.00202488 0.00114098 0.00952387 0.00602801 0.00114098 0.00114098\n",
      "  0.00202488 0.00378284 0.00181817 0.00114098 0.00181817 0.00181817\n",
      "  0.00855163 0.00181817 0.00181817 0.00457752 0.00952387 0.00322667\n",
      "  0.00213157 0.00322667 0.00457752 0.00181817 0.00181817 0.00602801\n",
      "  0.00213157 0.00181817 0.0028726  0.00378284 0.0028726  0.00378284\n",
      "  0.00181817 0.00202488 0.00213157 0.00509794 0.00213157 0.00213157\n",
      "  0.00181817 0.00202488 0.00202488 0.00202488 0.00602801 0.00322667\n",
      "  0.00322667 0.00322667 0.00322667 0.00181817 0.00812362 0.00114098\n",
      "  0.00114098 0.00322667 0.00114098 0.0028726  0.0028726  0.00202488\n",
      "  0.00322667 0.00181817 0.00213157 0.00952387 0.00181817 0.00457752\n",
      "  0.00213157 0.00509794 0.00952387 0.00457752 0.00181817 0.00536653\n",
      "  0.00536653 0.00322667 0.00181817 0.00322667 0.00181817 0.00181817\n",
      "  0.00602801 0.00952387 0.00181817 0.00213157 0.00202488 0.00602801\n",
      "  0.00322667 0.00181817 0.00181817 0.0028726  0.00181817 0.00114098\n",
      "  0.00322667 0.00812362 0.00114098 0.00181817 0.00322667 0.00181817\n",
      "  0.00202488 0.00181817 0.00181817 0.00536653 0.00339667 0.00114098\n",
      "  0.00181817 0.00378284 0.00322667 0.00322667 0.00114098 0.00812362\n",
      "  0.00213157 0.00812362 0.00181817 0.0028726  0.00952387 0.00536653\n",
      "  0.00812362 0.00509794 0.00213157 0.00855163 0.0028726  0.00181817\n",
      "  0.0028726  0.0028726  0.00181817 0.00322667 0.00213157 0.00181817\n",
      "  0.00536653 0.00322667 0.00181817 0.00181817 0.00322667 0.00536653\n",
      "  0.00812362 0.00812362 0.00114098 0.00536653 0.00213157 0.00602801\n",
      "  0.00181817 0.00181817 0.00322667 0.00114098 0.0028726  0.0028726\n",
      "  0.00322667 0.00181817 0.00322667 0.00213157 0.00322667 0.00181817\n",
      "  0.00181817 0.00181817 0.0028726  0.00213157 0.00536653 0.00114098\n",
      "  0.00457752 0.00213157 0.00114098 0.00322667 0.00952387]]\n",
      "classEst:  [[ 1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1.  1.  1.\n",
      "  -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1. -1. -1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[ 1.19803846  1.19803846  1.19803846  1.19803846  0.80196154  1.19803846\n",
      "   1.19803846  1.19803846  1.19803846  0.19803846  0.19803846  0.19803846\n",
      "   1.19803846  1.19803846  0.19803846  1.19803846  0.19803846  0.80196154\n",
      "   0.19803846  1.19803846  0.19803846  1.19803846  1.19803846  0.19803846\n",
      "   0.19803846 -0.19803846  0.19803846  1.19803846  0.80196154  0.19803846\n",
      "   0.19803846  1.19803846  0.19803846  0.19803846  0.19803846  0.19803846\n",
      "   0.80196154  0.19803846  1.19803846  0.80196154  0.19803846 -0.19803846\n",
      "   0.19803846  1.19803846  1.19803846  0.19803846  0.19803846  1.19803846\n",
      "   1.19803846  0.19803846  1.19803846  1.19803846  1.19803846  0.80196154\n",
      "   1.19803846  1.19803846  0.80196154  1.19803846  1.19803846  0.19803846\n",
      "   1.19803846  0.19803846  0.80196154  1.19803846  0.19803846  0.19803846\n",
      "   0.19803846  1.19803846  0.80196154  1.19803846  0.80196154  1.19803846\n",
      "   0.80196154  1.19803846  0.80196154  1.19803846  0.19803846  0.19803846\n",
      "   1.19803846  1.19803846  1.19803846  1.19803846  0.19803846  0.80196154\n",
      "   0.19803846  1.19803846  1.19803846  0.80196154  0.19803846  1.19803846\n",
      "  -0.19803846  1.19803846  1.19803846  1.19803846  1.19803846  0.19803846\n",
      "   0.19803846  1.19803846  1.19803846  1.19803846  0.19803846  1.19803846\n",
      "   0.80196154  0.19803846  1.19803846  0.19803846  0.80196154  1.19803846\n",
      "   1.19803846  1.19803846  1.19803846  1.19803846  1.19803846  0.80196154\n",
      "   0.19803846  0.19803846  0.19803846  1.19803846  0.19803846  0.19803846\n",
      "   1.19803846  0.19803846  1.19803846  1.19803846  1.19803846  1.19803846\n",
      "   1.19803846  1.19803846  1.19803846  0.80196154  0.80196154  1.19803846\n",
      "   1.19803846  0.19803846  1.19803846  1.19803846  1.19803846  0.19803846\n",
      "   0.19803846  1.19803846  0.80196154  0.19803846  1.19803846  1.19803846\n",
      "   0.19803846  0.19803846  1.19803846  1.19803846  0.19803846  0.19803846\n",
      "   1.19803846  0.19803846  1.19803846  0.19803846  1.19803846  1.19803846\n",
      "   1.19803846  1.19803846  1.19803846  0.80196154  0.80196154  0.19803846\n",
      "   1.19803846  0.19803846  1.19803846  1.19803846  1.19803846  1.19803846\n",
      "   0.80196154  1.19803846  1.19803846  0.19803846  1.19803846  0.80196154\n",
      "   0.80196154  0.19803846  0.80196154  0.19803846  1.19803846  1.19803846\n",
      "   0.80196154  0.80196154  0.19803846  0.19803846  1.19803846  0.19803846\n",
      "   0.19803846  0.19803846  0.19803846  1.19803846  0.19803846  0.19803846\n",
      "   0.19803846  0.19803846  0.19803846  1.19803846  1.19803846  0.19803846\n",
      "   0.19803846  1.19803846  1.19803846  0.80196154  1.19803846  1.19803846\n",
      "   1.19803846  0.19803846  0.80196154  1.19803846  1.19803846  1.19803846\n",
      "   1.19803846  0.19803846  1.19803846  0.19803846  1.19803846  0.80196154\n",
      "   0.80196154  1.19803846  1.19803846  1.19803846  0.19803846  1.19803846\n",
      "   0.19803846  1.19803846  1.19803846  1.19803846  0.80196154  0.19803846\n",
      "   0.19803846  0.19803846  0.19803846  0.80196154  0.19803846  1.19803846\n",
      "   1.19803846  1.19803846  1.19803846  1.19803846  1.19803846  0.19803846\n",
      "   1.19803846  1.19803846  0.19803846  0.19803846  0.19803846  0.19803846\n",
      "   1.19803846  0.19803846  1.19803846  1.19803846  1.19803846  1.19803846\n",
      "   0.19803846  0.19803846  1.19803846  1.19803846  1.19803846  1.19803846\n",
      "   1.19803846  0.19803846  0.80196154 -0.19803846  1.19803846  1.19803846\n",
      "   1.19803846  0.19803846  1.19803846  1.19803846  0.19803846  1.19803846\n",
      "   0.19803846  0.19803846  0.19803846  1.19803846  1.19803846  1.19803846\n",
      "   1.19803846  1.19803846  0.19803846  0.19803846  1.19803846  1.19803846\n",
      "  -0.19803846  1.19803846  0.19803846  0.80196154 -0.19803846  0.80196154\n",
      "   1.19803846  1.19803846  1.19803846  1.19803846  1.19803846  0.19803846\n",
      "   1.19803846  1.19803846  0.19803846  0.19803846  0.80196154]]\n",
      "total error:  0.42474916387959866\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:  [[0.00264952 0.0106296  0.00152086 0.00667055 0.00240286 0.00152086\n",
      "  0.00152086 0.00667055 0.00264952 0.00679523 0.00269904 0.00269904\n",
      "  0.00152086 0.00667055 0.00169377 0.00264952 0.00141823 0.00225997\n",
      "  0.00269904 0.00504229 0.00679523 0.00152086 0.00152086 0.00169377\n",
      "  0.00169377 0.00401073 0.00269904 0.00152086 0.0079665  0.00095441\n",
      "  0.00141823 0.00667055 0.00269904 0.00269904 0.00679523 0.00141823\n",
      "  0.00448898 0.0079665  0.00152086 0.00448898 0.00141823 0.00401073\n",
      "  0.00269904 0.00422204 0.00225997 0.00141823 0.01269471 0.00152086\n",
      "  0.00357061 0.00141823 0.00152086 0.00667055 0.00152086 0.00225997\n",
      "  0.00357061 0.00667055 0.00225997 0.00264952 0.00251691 0.00141823\n",
      "  0.00152086 0.00269904 0.00240286 0.00568982 0.00269904 0.00169377\n",
      "  0.00316426 0.00152086 0.00422204 0.00152086 0.00448898 0.00152086\n",
      "  0.00448898 0.00251691 0.0079665  0.00667055 0.00095441 0.00095441\n",
      "  0.00470204 0.00504229 0.00264952 0.00152086 0.00269904 0.00169377\n",
      "  0.00269904 0.00152086 0.00264952 0.0079665  0.00269904 0.00152086\n",
      "  0.00264952 0.00357061 0.00152086 0.00470204 0.00152086 0.00095441\n",
      "  0.00269904 0.00357061 0.00152086 0.00504229 0.00095441 0.00264952\n",
      "  0.00225997 0.00269904 0.00470204 0.00269904 0.00225997 0.00152086\n",
      "  0.00225997 0.00667055 0.00357061 0.00152086 0.00152086 0.00448898\n",
      "  0.00240286 0.00095441 0.00095441 0.01183809 0.00426431 0.00169377\n",
      "  0.00152086 0.00141823 0.00152086 0.00264952 0.01183809 0.00152086\n",
      "  0.00382899 0.00382899 0.00667055 0.00225997 0.0079665  0.00667055\n",
      "  0.00152086 0.00141823 0.00264952 0.00470204 0.00152086 0.00169377\n",
      "  0.00269904 0.00152086 0.00426431 0.00141823 0.00152086 0.00568982\n",
      "  0.00169377 0.00095441 0.01183809 0.00504229 0.00095441 0.00095441\n",
      "  0.00251691 0.00316426 0.00152086 0.00095441 0.00152086 0.00152086\n",
      "  0.0106296  0.00152086 0.00152086 0.00568982 0.0079665  0.00269904\n",
      "  0.00264952 0.00269904 0.00568982 0.00152086 0.00152086 0.00504229\n",
      "  0.00178301 0.00152086 0.00357061 0.00316426 0.00357061 0.00316426\n",
      "  0.00225997 0.00169377 0.00178301 0.00426431 0.00264952 0.00264952\n",
      "  0.00225997 0.00169377 0.00169377 0.00169377 0.00504229 0.00269904\n",
      "  0.00269904 0.00269904 0.00269904 0.00152086 0.00679523 0.00095441\n",
      "  0.00141823 0.00269904 0.00095441 0.00357061 0.00357061 0.00169377\n",
      "  0.00269904 0.00152086 0.00264952 0.0079665  0.00152086 0.00382899\n",
      "  0.00264952 0.00426431 0.0079665  0.00568982 0.00152086 0.00667055\n",
      "  0.00667055 0.00269904 0.00152086 0.00269904 0.00152086 0.00225997\n",
      "  0.00749276 0.01183809 0.00152086 0.00264952 0.00169377 0.00504229\n",
      "  0.00269904 0.00152086 0.00152086 0.00357061 0.00225997 0.00141823\n",
      "  0.00269904 0.00679523 0.00141823 0.00225997 0.00269904 0.00152086\n",
      "  0.00251691 0.00152086 0.00152086 0.00667055 0.00422204 0.00141823\n",
      "  0.00152086 0.00470204 0.00269904 0.00269904 0.00141823 0.00679523\n",
      "  0.00264952 0.00679523 0.00152086 0.00357061 0.01183809 0.00667055\n",
      "  0.00679523 0.00426431 0.00264952 0.0106296  0.00357061 0.00152086\n",
      "  0.00357061 0.00240286 0.00225997 0.00401073 0.00264952 0.00152086\n",
      "  0.00667055 0.00269904 0.00152086 0.00152086 0.00269904 0.00667055\n",
      "  0.00679523 0.00679523 0.00141823 0.00667055 0.00264952 0.00749276\n",
      "  0.00152086 0.00152086 0.00269904 0.00095441 0.00357061 0.00357061\n",
      "  0.00401073 0.00152086 0.00269904 0.00178301 0.00401073 0.00225997\n",
      "  0.00152086 0.00152086 0.00357061 0.00264952 0.00667055 0.00095441\n",
      "  0.00568982 0.00264952 0.00141823 0.00269904 0.0079665 ]]\n",
      "classEst:  [[-1.  1.  1. -1.  1.  1.  1. -1. -1.  1. -1.  1.  1.  1. -1. -1. -1.  1.\n",
      "   1. -1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1.  1.  1. -1. -1.\n",
      "   1.  1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1.  1.  1.  1.  1.\n",
      "  -1. -1.  1.  1. -1. -1.  1.  1.  1. -1. -1. -1.  1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1. -1. -1.  1. -1.  1. -1.  1. -1. -1.  1.  1. -1.  1.  1.  1.\n",
      "   1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1.  1.  1.  1.  1.  1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1.  1. -1.  1.  1.  1.  1.  1.  1. -1. -1.\n",
      "  -1. -1.  1.  1.  1. -1.  1. -1. -1. -1.  1.  1.  1. -1.  1. -1.  1. -1.\n",
      "  -1.  1.  1.  1.  1. -1. -1. -1. -1.  1. -1.  1.  1. -1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1.  1.  1.  1. -1. -1. -1. -1.  1.  1.  1. -1. -1. -1.\n",
      "   1. -1.  1.  1. -1.  1. -1.  1. -1.  1.  1.  1. -1.  1. -1.  1. -1.  1.\n",
      "  -1.  1.  1.  1.  1. -1. -1.  1.  1. -1. -1.  1. -1.  1. -1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1. -1.  1.  1.  1. -1.  1. -1.  1. -1. -1.  1. -1. -1.\n",
      "   1.  1.  1. -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1.  1. -1. -1. -1.\n",
      "  -1. -1.  1.  1. -1.  1. -1.  1.  1.  1.  1. -1. -1.  1. -1.  1.  1. -1.\n",
      "  -1. -1. -1.  1.  1. -1.  1.  1. -1.  1. -1. -1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1. -1.  1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[ 0.81152113  1.18847887  0.18847887  0.81152113  1.18847887  0.18847887\n",
      "   0.18847887  0.81152113  0.81152113  0.18847887 -0.18847887  0.18847887\n",
      "   0.18847887  1.18847887 -0.18847887  0.81152113  0.81152113  0.18847887\n",
      "   0.18847887 -0.18847887  0.18847887  0.18847887  0.18847887  0.18847887\n",
      "  -0.18847887  1.18847887 -0.18847887 -0.18847887  1.18847887  0.18847887\n",
      "   0.81152113  0.81152113  0.18847887  0.18847887 -0.18847887  0.81152113\n",
      "   1.18847887  0.18847887  0.18847887  1.18847887  0.81152113  1.18847887\n",
      "  -0.18847887  0.81152113  0.81152113  0.81152113 -0.18847887  0.18847887\n",
      "   0.81152113  0.81152113  0.18847887  1.18847887  0.18847887  0.18847887\n",
      "   0.81152113  0.81152113  0.18847887  1.18847887  0.81152113  0.81152113\n",
      "   0.18847887  0.18847887  1.18847887  0.81152113 -0.18847887 -0.18847887\n",
      "   0.18847887  0.18847887  0.18847887  0.18847887  0.81152113  0.18847887\n",
      "   1.18847887  1.18847887  1.18847887  0.81152113 -0.18847887  0.18847887\n",
      "   0.81152113  0.18847887  0.81152113  0.18847887 -0.18847887  0.81152113\n",
      "   0.18847887  0.18847887  0.81152113  1.18847887  0.18847887  0.18847887\n",
      "   1.18847887  0.81152113 -0.18847887  0.81152113 -0.18847887  0.18847887\n",
      "   0.18847887  0.81152113  0.18847887 -0.18847887 -0.18847887  0.81152113\n",
      "  -0.18847887  0.18847887  1.18847887  0.18847887  0.18847887  0.18847887\n",
      "   0.81152113  0.81152113  0.81152113 -0.18847887  0.18847887  1.18847887\n",
      "  -0.18847887 -0.18847887  0.18847887  0.81152113  0.18847887  0.18847887\n",
      "   0.18847887  1.18847887  0.18847887  1.18847887  0.81152113 -0.18847887\n",
      "  -0.18847887 -0.18847887  1.18847887  0.18847887  1.18847887  0.81152113\n",
      "   0.18847887  0.81152113  0.81152113  0.81152113  0.18847887  0.18847887\n",
      "   0.18847887 -0.18847887  1.18847887  0.81152113  0.18847887  0.81152113\n",
      "  -0.18847887  0.18847887  1.18847887  0.18847887  0.18847887 -0.18847887\n",
      "   0.81152113 -0.18847887 -0.18847887  0.18847887 -0.18847887  0.18847887\n",
      "   1.18847887 -0.18847887  0.18847887  0.18847887  1.18847887 -0.18847887\n",
      "   1.18847887  0.18847887  1.18847887  0.18847887  0.18847887  0.18847887\n",
      "   1.18847887  0.18847887  0.81152113 -0.18847887  0.81152113  0.81152113\n",
      "   0.18847887  0.18847887  1.18847887 -0.18847887  0.81152113  0.81152113\n",
      "   0.18847887  0.81152113  0.18847887  0.18847887 -0.18847887  0.18847887\n",
      "  -0.18847887  0.18847887 -0.18847887  0.18847887  0.18847887  0.18847887\n",
      "   0.81152113  0.18847887 -0.18847887  1.18847887  0.81152113  0.18847887\n",
      "  -0.18847887  0.18847887  1.18847887  1.18847887  0.18847887 -0.18847887\n",
      "   0.81152113  0.18847887  1.18847887  0.81152113 -0.18847887  1.18847887\n",
      "   0.81152113  0.18847887 -0.18847887  0.18847887  0.18847887  0.18847887\n",
      "   0.18847887  1.18847887 -0.18847887  0.81152113 -0.18847887 -0.18847887\n",
      "   0.18847887  0.18847887  0.18847887  0.81152113  0.18847887  0.81152113\n",
      "   0.18847887 -0.18847887  0.81152113  0.18847887 -0.18847887 -0.18847887\n",
      "   1.18847887  0.18847887  0.18847887  0.81152113  1.18847887  0.81152113\n",
      "   0.18847887  1.18847887  0.18847887  0.18847887  0.81152113 -0.18847887\n",
      "   0.81152113  0.18847887  0.18847887  0.81152113  0.81152113  0.81152113\n",
      "  -0.18847887 -0.18847887  1.18847887  1.18847887  0.81152113  0.18847887\n",
      "   0.81152113  0.18847887  0.18847887  1.18847887  1.18847887 -0.18847887\n",
      "   0.81152113  0.18847887 -0.18847887  0.18847887  0.18847887  0.81152113\n",
      "  -0.18847887 -0.18847887  0.81152113  1.18847887  1.18847887  0.81152113\n",
      "   0.18847887  0.18847887 -0.18847887  0.18847887  0.81152113  0.81152113\n",
      "   1.18847887  0.18847887  0.18847887  0.81152113  1.18847887  0.18847887\n",
      "   0.18847887  0.18847887  0.81152113  1.18847887  0.81152113  0.18847887\n",
      "   0.81152113  0.81152113  0.81152113 -0.18847887  1.18847887]]\n",
      "total error:  0.5953177257525084\n",
      "D:  [[0.00223347 0.01306294 0.00128204 0.00562309 0.00295293 0.00128204\n",
      "  0.00128204 0.00562309 0.00223347 0.00572819 0.00331691 0.00227522\n",
      "  0.00128204 0.00819758 0.00208151 0.00223347 0.00119553 0.0019051\n",
      "  0.00227522 0.00619658 0.00572819 0.00128204 0.00128204 0.0014278\n",
      "  0.00208151 0.00338093 0.00331691 0.00186902 0.0097902  0.00080454\n",
      "  0.00119553 0.00562309 0.00227522 0.00227522 0.0083508  0.00119553\n",
      "  0.0055166  0.00671554 0.00128204 0.0055166  0.00119553 0.00338093\n",
      "  0.00331691 0.00355906 0.0019051  0.00119553 0.0156008  0.00128204\n",
      "  0.00300993 0.00119553 0.00128204 0.00819758 0.00128204 0.0019051\n",
      "  0.00300993 0.00562309 0.0019051  0.00325605 0.00212169 0.00119553\n",
      "  0.00128204 0.00227522 0.00295293 0.00479636 0.00331691 0.00208151\n",
      "  0.00266739 0.00128204 0.00355906 0.00128204 0.00378409 0.00128204\n",
      "  0.0055166  0.00309309 0.0097902  0.00562309 0.00117289 0.00080454\n",
      "  0.00396369 0.00425051 0.00223347 0.00128204 0.00331691 0.0014278\n",
      "  0.00227522 0.00128204 0.00223347 0.0097902  0.00227522 0.00128204\n",
      "  0.00223347 0.00300993 0.00186902 0.00396369 0.00186902 0.00080454\n",
      "  0.00227522 0.00300993 0.00128204 0.00619658 0.00117289 0.00223347\n",
      "  0.00277733 0.00227522 0.00577844 0.00227522 0.0019051  0.00128204\n",
      "  0.0019051  0.00562309 0.00300993 0.00186902 0.00128204 0.0055166\n",
      "  0.00295293 0.00117289 0.00080454 0.00997918 0.0035947  0.0014278\n",
      "  0.00128204 0.0017429  0.00128204 0.00325605 0.00997918 0.00186902\n",
      "  0.00470553 0.00470553 0.00819758 0.0019051  0.0097902  0.00562309\n",
      "  0.00128204 0.00119553 0.00223347 0.00396369 0.00128204 0.0014278\n",
      "  0.00227522 0.00186902 0.0052405  0.00119553 0.00128204 0.00479636\n",
      "  0.00208151 0.00080454 0.01454808 0.00425051 0.00080454 0.00117289\n",
      "  0.00212169 0.00388863 0.00186902 0.00080454 0.00186902 0.00128204\n",
      "  0.01306294 0.00186902 0.00128204 0.00479636 0.0097902  0.00331691\n",
      "  0.00325605 0.00227522 0.00699234 0.00128204 0.00128204 0.00425051\n",
      "  0.00219117 0.00128204 0.00300993 0.00388863 0.00300993 0.00266739\n",
      "  0.0019051  0.0014278  0.00219117 0.0052405  0.00223347 0.00223347\n",
      "  0.0019051  0.0014278  0.0014278  0.0014278  0.00619658 0.00227522\n",
      "  0.00331691 0.00227522 0.00331691 0.00128204 0.00572819 0.00080454\n",
      "  0.00119553 0.00227522 0.00117289 0.004388   0.00300993 0.0014278\n",
      "  0.00331691 0.00128204 0.00325605 0.0097902  0.00128204 0.00470553\n",
      "  0.00223347 0.0035947  0.0097902  0.00479636 0.00186902 0.00819758\n",
      "  0.00562309 0.00227522 0.00186902 0.00227522 0.00128204 0.0019051\n",
      "  0.00631619 0.01454808 0.00186902 0.00223347 0.00208151 0.00619658\n",
      "  0.00227522 0.00128204 0.00128204 0.00300993 0.0019051  0.00119553\n",
      "  0.00227522 0.0083508  0.00119553 0.0019051  0.00331691 0.00186902\n",
      "  0.00309309 0.00128204 0.00128204 0.00562309 0.00518855 0.00119553\n",
      "  0.00128204 0.00577844 0.00227522 0.00227522 0.00119553 0.0083508\n",
      "  0.00223347 0.00572819 0.00128204 0.00300993 0.00997918 0.00562309\n",
      "  0.0083508  0.0052405  0.00325605 0.01306294 0.00300993 0.00128204\n",
      "  0.00300993 0.00202555 0.0019051  0.00338093 0.00325605 0.00186902\n",
      "  0.00562309 0.00227522 0.00186902 0.00128204 0.00227522 0.00562309\n",
      "  0.0083508  0.0083508  0.00119553 0.00819758 0.00325605 0.00631619\n",
      "  0.00128204 0.00128204 0.00331691 0.00080454 0.00300993 0.00300993\n",
      "  0.00338093 0.00128204 0.00227522 0.00150303 0.00338093 0.0019051\n",
      "  0.00128204 0.00128204 0.00300993 0.00325605 0.00562309 0.00080454\n",
      "  0.00479636 0.00223347 0.00119553 0.00331691 0.0097902 ]]\n",
      "classEst:  [[-1. -1. -1. -1. -1.  1. -1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.\n",
      "  -1. -1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1. -1.  1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1.\n",
      "   1.  1. -1.  1.  1. -1. -1.  1.  1. -1. -1. -1. -1.  1.  1. -1.  1.  1.\n",
      "  -1.  1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1. -1.  1.  1. -1.  1. -1.\n",
      "  -1.  1.  1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1. -1.  1.  1. -1. -1.\n",
      "  -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1.\n",
      "  -1.  1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1. -1. -1. -1. -1.  1.  1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1.  1. -1.  1. -1. -1.  1.\n",
      "  -1.  1. -1. -1.  1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1.  1.  1.\n",
      "  -1. -1.  1.  1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1. -1. -1.\n",
      "  -1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1.  1.  1.  1. -1.\n",
      "  -1. -1.  1. -1. -1.  1.  1. -1.  1. -1. -1.  1.  1. -1. -1. -1.  1. -1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1.  1.  1.  1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1.  1.  1. -1.  1. -1.  1.  1.  1. -1. -1. -1. -1.  1.\n",
      "   1.  1. -1. -1. -1.  1.  1. -1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1.\n",
      "  -1. -1.  1. -1.  1. -1. -1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[ 0.84772631  0.84772631 -0.15227369  0.84772631  0.84772631  0.15227369\n",
      "  -0.15227369  1.15227369  1.15227369  0.15227369  1.15227369 -0.15227369\n",
      "   0.15227369  1.15227369  1.15227369  1.15227369  1.15227369 -0.15227369\n",
      "  -0.15227369  0.84772631  0.15227369  0.15227369 -0.15227369 -0.15227369\n",
      "   1.15227369 -0.15227369  1.15227369  0.84772631  0.84772631 -0.15227369\n",
      "   1.15227369  0.84772631  0.15227369 -0.15227369  1.15227369  0.84772631\n",
      "   0.84772631 -0.15227369 -0.15227369  0.84772631  0.84772631 -0.15227369\n",
      "   0.84772631  0.84772631  1.15227369  0.84772631  1.15227369 -0.15227369\n",
      "   1.15227369  0.84772631 -0.15227369  0.84772631 -0.15227369 -0.15227369\n",
      "   1.15227369  1.15227369 -0.15227369  1.15227369  1.15227369  0.84772631\n",
      "  -0.15227369  0.15227369  1.15227369  0.84772631  0.84772631  0.84772631\n",
      "  -0.15227369  0.15227369  0.15227369 -0.15227369  1.15227369  0.15227369\n",
      "   0.84772631  1.15227369  0.84772631  0.84772631  0.84772631 -0.15227369\n",
      "   1.15227369  0.15227369  0.84772631  0.15227369  0.84772631  0.84772631\n",
      "  -0.15227369  0.15227369  1.15227369  0.84772631  0.15227369 -0.15227369\n",
      "  -0.15227369  1.15227369  1.15227369  0.84772631  0.84772631  0.15227369\n",
      "   0.15227369  0.84772631 -0.15227369  0.84772631  0.84772631  0.84772631\n",
      "   0.84772631 -0.15227369  1.15227369  0.15227369 -0.15227369 -0.15227369\n",
      "   0.84772631  0.84772631  1.15227369  0.84772631 -0.15227369  0.84772631\n",
      "   1.15227369  0.84772631  0.15227369  0.84772631 -0.15227369 -0.15227369\n",
      "  -0.15227369  0.84772631 -0.15227369  1.15227369  1.15227369  1.15227369\n",
      "   0.84772631  1.15227369  0.84772631  0.15227369  0.84772631  0.84772631\n",
      "  -0.15227369  1.15227369  1.15227369  1.15227369  0.15227369 -0.15227369\n",
      "  -0.15227369  0.84772631  0.84772631  0.84772631  0.15227369  1.15227369\n",
      "   1.15227369 -0.15227369  0.84772631  0.15227369 -0.15227369  0.84772631\n",
      "   0.84772631  1.15227369  1.15227369  0.15227369  1.15227369 -0.15227369\n",
      "   1.15227369  0.84772631  0.15227369 -0.15227369  0.84772631  1.15227369\n",
      "   0.84772631  0.15227369  0.84772631 -0.15227369  0.15227369  0.15227369\n",
      "   1.15227369 -0.15227369  0.84772631  0.84772631  0.84772631  0.84772631\n",
      "  -0.15227369  0.15227369  0.84772631  0.84772631  1.15227369  1.15227369\n",
      "  -0.15227369  0.84772631  0.15227369  0.15227369  0.84772631 -0.15227369\n",
      "   1.15227369 -0.15227369  1.15227369 -0.15227369 -0.15227369 -0.15227369\n",
      "   0.84772631 -0.15227369  0.84772631  1.15227369  0.84772631 -0.15227369\n",
      "   0.84772631  0.15227369  1.15227369  0.84772631  0.15227369  1.15227369\n",
      "   1.15227369  0.15227369  0.84772631  1.15227369  1.15227369  0.84772631\n",
      "   0.84772631  0.15227369  1.15227369  0.15227369  0.15227369 -0.15227369\n",
      "  -0.15227369  0.84772631  1.15227369  0.84772631  0.84772631  1.15227369\n",
      "   0.15227369 -0.15227369  0.15227369  0.84772631 -0.15227369  1.15227369\n",
      "   0.15227369  0.84772631  0.84772631 -0.15227369  1.15227369  0.84772631\n",
      "   1.15227369 -0.15227369 -0.15227369  1.15227369  0.84772631  0.84772631\n",
      "  -0.15227369  1.15227369 -0.15227369 -0.15227369  0.84772631  1.15227369\n",
      "   1.15227369  0.15227369  0.15227369  0.84772631  0.84772631  0.84772631\n",
      "   0.84772631  0.84772631  0.84772631  0.84772631  0.84772631  0.15227369\n",
      "   1.15227369 -0.15227369  0.15227369 -0.15227369  1.15227369  1.15227369\n",
      "   1.15227369 -0.15227369  0.84772631 -0.15227369 -0.15227369  1.15227369\n",
      "   1.15227369  1.15227369  0.84772631  0.84772631  0.84772631  1.15227369\n",
      "   0.15227369 -0.15227369  1.15227369 -0.15227369  0.84772631  1.15227369\n",
      "  -0.15227369  0.15227369  0.15227369  0.84772631 -0.15227369 -0.15227369\n",
      "  -0.15227369 -0.15227369  1.15227369  0.84772631  1.15227369 -0.15227369\n",
      "   0.84772631  1.15227369  1.15227369  1.15227369  0.84772631]]\n",
      "total error:  0.6555183946488294\n",
      "D:  [[0.00194028 0.01134815 0.00151025 0.00488494 0.00256529 0.00111375\n",
      "  0.00151025 0.00662403 0.00263104 0.00497624 0.00288149 0.00268022\n",
      "  0.00111375 0.0096568  0.00180826 0.00263104 0.00140834 0.00224421\n",
      "  0.00268022 0.0072996  0.00497624 0.00111375 0.00151025 0.00168196\n",
      "  0.00180826 0.00398276 0.00288149 0.00220171 0.00850503 0.00094775\n",
      "  0.00140834 0.00488494 0.00197654 0.00268022 0.00725458 0.00103859\n",
      "  0.00479243 0.00791094 0.00151025 0.00479243 0.00103859 0.00398276\n",
      "  0.00390733 0.00309186 0.00224421 0.00103859 0.01355286 0.00151025\n",
      "  0.00354571 0.00103859 0.00151025 0.00712147 0.00151025 0.00224421\n",
      "  0.00354571 0.00662403 0.00224421 0.00383564 0.00249936 0.00103859\n",
      "  0.00151025 0.00197654 0.00347857 0.00416673 0.00390733 0.00245203\n",
      "  0.0031422  0.00111375 0.00309186 0.00151025 0.00445768 0.00111375\n",
      "  0.00479243 0.00364367 0.00850503 0.00488494 0.00138167 0.00094775\n",
      "  0.00466925 0.00369254 0.00194028 0.00111375 0.00390733 0.00124037\n",
      "  0.00268022 0.00111375 0.00263104 0.00850503 0.00197654 0.00151025\n",
      "  0.00263104 0.00354571 0.00162367 0.00344337 0.00220171 0.00069893\n",
      "  0.00197654 0.00261481 0.00151025 0.0072996  0.00138167 0.00194028\n",
      "  0.00327171 0.00268022 0.00680704 0.00197654 0.00224421 0.00151025\n",
      "  0.00165501 0.00488494 0.00354571 0.00220171 0.00151025 0.00479243\n",
      "  0.00256529 0.00138167 0.00069893 0.0086692  0.00423457 0.00168196\n",
      "  0.00151025 0.00151411 0.00151025 0.00383564 0.01175553 0.00162367\n",
      "  0.00554314 0.00408783 0.00712147 0.00165501 0.00850503 0.00488494\n",
      "  0.00151025 0.00140834 0.00263104 0.00466925 0.00111375 0.00168196\n",
      "  0.00268022 0.00220171 0.00455257 0.00103859 0.00111375 0.00565014\n",
      "  0.00180826 0.00094775 0.01263833 0.00369254 0.00094775 0.00138167\n",
      "  0.00184317 0.00337816 0.00162367 0.00069893 0.00162367 0.00151025\n",
      "  0.01538822 0.00220171 0.00111375 0.00565014 0.00850503 0.00288149\n",
      "  0.00282862 0.00197654 0.00607444 0.00151025 0.00111375 0.00369254\n",
      "  0.00258122 0.00151025 0.00261481 0.00458083 0.00261481 0.00231724\n",
      "  0.00224421 0.00124037 0.00190354 0.00617334 0.00263104 0.00263104\n",
      "  0.00224421 0.00124037 0.00124037 0.00124037 0.0072996  0.00268022\n",
      "  0.00288149 0.00268022 0.00288149 0.00151025 0.00674784 0.00094775\n",
      "  0.00103859 0.00268022 0.00138167 0.00516909 0.00261481 0.00168196\n",
      "  0.00390733 0.00111375 0.00383564 0.00850503 0.00111375 0.00408783\n",
      "  0.00263104 0.00312281 0.00850503 0.00565014 0.00162367 0.00712147\n",
      "  0.00488494 0.00197654 0.00162367 0.00197654 0.00111375 0.00224421\n",
      "  0.00744051 0.01263833 0.00162367 0.00194028 0.00245203 0.00538314\n",
      "  0.00197654 0.00151025 0.00111375 0.00261481 0.00224421 0.00140834\n",
      "  0.00197654 0.00983729 0.00103859 0.00224421 0.00288149 0.00220171\n",
      "  0.00364367 0.00151025 0.00151025 0.00662403 0.00450744 0.00103859\n",
      "  0.00151025 0.00680704 0.00268022 0.00268022 0.00103859 0.00725458\n",
      "  0.00263104 0.00497624 0.00111375 0.00261481 0.0086692  0.00488494\n",
      "  0.00983729 0.00617334 0.00282862 0.01134815 0.00261481 0.00111375\n",
      "  0.00354571 0.00238611 0.00165501 0.00398276 0.00383564 0.00162367\n",
      "  0.00662403 0.00268022 0.00220171 0.00151025 0.00268022 0.00662403\n",
      "  0.00725458 0.00725458 0.00103859 0.00712147 0.00282862 0.00744051\n",
      "  0.00111375 0.00151025 0.00288149 0.00094775 0.00261481 0.00354571\n",
      "  0.00398276 0.00111375 0.00197654 0.00130572 0.00398276 0.00224421\n",
      "  0.00151025 0.00151025 0.00354571 0.00282862 0.00662403 0.00094775\n",
      "  0.00416673 0.00263104 0.00140834 0.00288149 0.00850503]]\n",
      "classEst:  [[ 1. -1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1.  1. -1.  1. -1. -1.  1.\n",
      "  -1. -1. -1.  1. -1.  1. -1.  1. -1.  1.  1.  1. -1. -1.  1.  1. -1. -1.\n",
      "  -1.  1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1.\n",
      "   1. -1.  1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1.  1.  1.  1.\n",
      "   1. -1.  1. -1.  1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1.  1.\n",
      "   1.  1.  1.  1. -1. -1. -1. -1. -1. -1.  1. -1.  1.  1. -1. -1. -1. -1.\n",
      "  -1. -1. -1.  1.  1.  1. -1.  1.  1. -1.  1. -1. -1. -1.  1. -1. -1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1.  1. -1. -1.  1. -1.\n",
      "  -1. -1. -1. -1.  1.  1. -1. -1.  1. -1. -1.  1. -1.  1. -1.  1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1. -1. -1.\n",
      "   1. -1. -1. -1. -1.  1.  1.  1.  1. -1.  1.  1. -1. -1.  1. -1.  1.  1.\n",
      "  -1. -1. -1.  1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1. -1.  1.  1.  1.\n",
      "   1. -1. -1.  1.  1. -1. -1.  1.  1. -1.  1. -1.  1.  1. -1.  1. -1. -1.\n",
      "  -1.  1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1. -1.  1. -1. -1. -1.\n",
      "  -1. -1.  1.  1. -1.  1.  1.  1.  1.  1. -1. -1.  1. -1. -1.  1.  1.  1.\n",
      "  -1. -1. -1.  1. -1.  1. -1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.\n",
      "   1. -1. -1. -1. -1.  1. -1. -1. -1. -1.  1.]]\n",
      "aggClassEst:  [[ 1.15510871  0.84489129  0.84489129  0.84489129  0.84489129 -0.15510871\n",
      "   1.15510871  1.15510871  0.84489129  0.15510871 -0.15510871  0.84489129\n",
      "   0.15510871  0.84489129  0.15510871  0.84489129  0.84489129  1.15510871\n",
      "   0.84489129 -0.15510871 -0.15510871  0.15510871  0.84489129  1.15510871\n",
      "  -0.15510871  1.15510871 -0.15510871  0.15510871  1.15510871  1.15510871\n",
      "   0.84489129  0.84489129  0.15510871  1.15510871 -0.15510871  0.84489129\n",
      "   0.84489129  1.15510871  1.15510871  1.15510871  0.84489129  1.15510871\n",
      "  -0.15510871  0.84489129  0.84489129  0.84489129 -0.15510871  1.15510871\n",
      "   0.84489129  0.84489129  0.84489129  0.84489129  0.84489129  1.15510871\n",
      "   1.15510871  0.84489129  1.15510871  0.84489129  0.84489129  0.84489129\n",
      "   0.84489129  0.15510871  0.84489129  0.84489129 -0.15510871 -0.15510871\n",
      "   0.84489129  0.15510871 -0.15510871  1.15510871  1.15510871  0.15510871\n",
      "   1.15510871  0.84489129  1.15510871  0.84489129  0.15510871  1.15510871\n",
      "   0.84489129 -0.15510871  0.84489129  0.15510871 -0.15510871  0.84489129\n",
      "   0.84489129 -0.15510871  0.84489129  1.15510871 -0.15510871  1.15510871\n",
      "   1.15510871  1.15510871  0.15510871  1.15510871 -0.15510871 -0.15510871\n",
      "  -0.15510871  0.84489129  0.84489129 -0.15510871  0.15510871  0.84489129\n",
      "   0.15510871  1.15510871  0.84489129 -0.15510871  0.84489129  0.84489129\n",
      "   0.84489129  0.84489129  0.84489129  0.15510871  1.15510871  1.15510871\n",
      "  -0.15510871  0.15510871  0.15510871  0.84489129  1.15510871  0.84489129\n",
      "   0.84489129  0.84489129  1.15510871  0.84489129  0.84489129  0.15510871\n",
      "  -0.15510871  0.15510871  0.84489129  0.15510871  1.15510871  1.15510871\n",
      "   1.15510871  0.84489129  0.84489129  0.84489129  0.15510871  0.84489129\n",
      "   1.15510871  0.15510871  0.84489129  0.84489129  0.15510871  0.84489129\n",
      "  -0.15510871  0.84489129  0.84489129 -0.15510871  1.15510871  0.15510871\n",
      "   0.84489129 -0.15510871  0.15510871 -0.15510871 -0.15510871  1.15510871\n",
      "   0.84489129  0.15510871 -0.15510871  1.15510871  1.15510871  0.15510871\n",
      "   0.84489129 -0.15510871  0.84489129  1.15510871  0.15510871 -0.15510871\n",
      "   1.15510871  0.84489129  0.84489129 -0.15510871  0.84489129  0.84489129\n",
      "   1.15510871 -0.15510871  0.84489129 -0.15510871  0.84489129  0.84489129\n",
      "   1.15510871  0.84489129 -0.15510871 -0.15510871 -0.15510871  1.15510871\n",
      "   0.15510871  1.15510871  0.15510871  0.84489129  1.15510871  1.15510871\n",
      "   0.84489129  0.84489129  0.15510871  0.84489129  1.15510871  1.15510871\n",
      "  -0.15510871 -0.15510871  0.84489129  1.15510871  0.15510871 -0.15510871\n",
      "   0.84489129 -0.15510871  1.15510871  0.84489129  0.15510871  0.84489129\n",
      "   0.84489129 -0.15510871 -0.15510871  0.15510871  0.15510871  1.15510871\n",
      "   1.15510871  0.84489129 -0.15510871  1.15510871  0.15510871 -0.15510871\n",
      "  -0.15510871  1.15510871  0.15510871  0.84489129  1.15510871  0.84489129\n",
      "   0.15510871  0.15510871  0.84489129  1.15510871 -0.15510871 -0.15510871\n",
      "   0.84489129  1.15510871  0.84489129  0.84489129  1.15510871  0.84489129\n",
      "   0.84489129  0.84489129  1.15510871  0.84489129  0.84489129 -0.15510871\n",
      "   0.84489129 -0.15510871  0.15510871  0.84489129  0.84489129  0.84489129\n",
      "  -0.15510871 -0.15510871  1.15510871  1.15510871  0.84489129  0.15510871\n",
      "   1.15510871  1.15510871  0.15510871  1.15510871  0.84489129 -0.15510871\n",
      "   1.15510871  0.84489129 -0.15510871  1.15510871  1.15510871  1.15510871\n",
      "  -0.15510871 -0.15510871  0.84489129  1.15510871  0.84489129  1.15510871\n",
      "  -0.15510871  1.15510871  0.15510871  1.15510871  0.84489129  0.84489129\n",
      "   1.15510871  0.15510871  0.15510871  1.15510871  1.15510871  1.15510871\n",
      "   1.15510871  0.84489129  0.84489129  0.84489129  0.84489129  1.15510871\n",
      "   0.84489129  0.84489129  0.84489129 -0.15510871  1.15510871]]\n",
      "total error:  0.5986622073578596\n",
      "D:  [[0.00229314 0.0098348  0.00178491 0.0042335  0.0022232  0.00131629\n",
      "  0.00130885 0.00782869 0.00228018 0.00431263 0.00340552 0.00316764\n",
      "  0.00096522 0.008369   0.00156712 0.00228018 0.00122053 0.00194493\n",
      "  0.00316764 0.00862712 0.00588122 0.00096522 0.00178491 0.00145766\n",
      "  0.00213712 0.00345163 0.00340552 0.0019081  0.01005176 0.00082136\n",
      "  0.00122053 0.0042335  0.00171296 0.00232279 0.0085739  0.00090009\n",
      "  0.00415333 0.00685597 0.00130885 0.00566399 0.00090009 0.00345163\n",
      "  0.00461792 0.00267954 0.00194493 0.00090009 0.01601759 0.00130885\n",
      "  0.00307287 0.00090009 0.00178491 0.00617178 0.00178491 0.00194493\n",
      "  0.00419054 0.00574068 0.00194493 0.00332414 0.00216605 0.00090009\n",
      "  0.00178491 0.00171296 0.00301468 0.00361107 0.00461792 0.00289795\n",
      "  0.00371364 0.00096522 0.00365415 0.00130885 0.00526835 0.00096522\n",
      "  0.00566399 0.00315777 0.01005176 0.0042335  0.00119742 0.00082136\n",
      "  0.00404658 0.00436407 0.00168153 0.00096522 0.00461792 0.00107496\n",
      "  0.00316764 0.00131629 0.00228018 0.01005176 0.002336   0.00130885\n",
      "  0.00228018 0.00419054 0.00140714 0.00406959 0.00260212 0.00082603\n",
      "  0.002336   0.00226611 0.00178491 0.00862712 0.00119742 0.00168153\n",
      "  0.00283541 0.00232279 0.00589928 0.002336   0.00265235 0.00178491\n",
      "  0.0014343  0.0042335  0.00307287 0.0019081  0.00130885 0.00566399\n",
      "  0.00303182 0.00119742 0.00060572 0.00751311 0.00366986 0.00198784\n",
      "  0.00178491 0.00131219 0.00130885 0.00332414 0.01018786 0.00140714\n",
      "  0.00655122 0.00354269 0.00617178 0.0014343  0.01005176 0.00577332\n",
      "  0.00130885 0.00122053 0.00228018 0.00404658 0.00096522 0.00198784\n",
      "  0.00232279 0.0019081  0.00394546 0.00090009 0.00096522 0.00489666\n",
      "  0.00213712 0.00112011 0.01095293 0.00436407 0.00082136 0.00119742\n",
      "  0.00159737 0.00399252 0.00140714 0.00082603 0.00191895 0.00130885\n",
      "  0.0133361  0.0019081  0.00131629 0.00489666 0.01005176 0.00249723\n",
      "  0.00245141 0.002336   0.00526438 0.00130885 0.00096522 0.00436407\n",
      "  0.00305064 0.00178491 0.00226611 0.0054139  0.00226611 0.00200822\n",
      "  0.00194493 0.00146594 0.00164969 0.00729603 0.00228018 0.00228018\n",
      "  0.00194493 0.00107496 0.00146594 0.00146594 0.00862712 0.00232279\n",
      "  0.00249723 0.00232279 0.00249723 0.00178491 0.00584797 0.00082136\n",
      "  0.00090009 0.00316764 0.00119742 0.00447976 0.00309034 0.00145766\n",
      "  0.00461792 0.00131629 0.00332414 0.01005176 0.00096522 0.00483124\n",
      "  0.00228018 0.00369073 0.01005176 0.00489666 0.00140714 0.00617178\n",
      "  0.0042335  0.002336   0.00191895 0.00171296 0.00096522 0.00194493\n",
      "  0.00644827 0.01095293 0.00191895 0.00229314 0.00212503 0.00636213\n",
      "  0.002336   0.00130885 0.00096522 0.00226611 0.00194493 0.00122053\n",
      "  0.00171296 0.00852542 0.00090009 0.00194493 0.00340552 0.00260212\n",
      "  0.00315777 0.00130885 0.00178491 0.00574068 0.00532717 0.00090009\n",
      "  0.00178491 0.00589928 0.00232279 0.00316764 0.00090009 0.0085739\n",
      "  0.00228018 0.00588122 0.00096522 0.00226611 0.00751311 0.0042335\n",
      "  0.0116263  0.00729603 0.00334304 0.01341194 0.00226611 0.00096522\n",
      "  0.00419054 0.0020679  0.0014343  0.00345163 0.00332414 0.00191895\n",
      "  0.00782869 0.00316764 0.00260212 0.00130885 0.00232279 0.00782869\n",
      "  0.0085739  0.0085739  0.00090009 0.00841659 0.00245141 0.00879365\n",
      "  0.00131629 0.00130885 0.00249723 0.00082136 0.00226611 0.00307287\n",
      "  0.00345163 0.00096522 0.00171296 0.00154318 0.00345163 0.00194493\n",
      "  0.00130885 0.00178491 0.00307287 0.00245141 0.00574068 0.00082136\n",
      "  0.00361107 0.00228018 0.00122053 0.00340552 0.01005176]]\n",
      "classEst:  [[ 1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1. -1.  1. -1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.\n",
      "   1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "  -1.  1. -1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1.\n",
      "  -1.  1.  1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.\n",
      "   1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.\n",
      "   1.  1.  1. -1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1. -1.  1.\n",
      "   1.  1. -1.  1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1.  1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1.  1.  1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.  1. -1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1.  1. -1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.  1.\n",
      "   1.  1.  1.  1.  1.  1.  1. -1.  1. -1. -1.  1.  1.  1.  1. -1.  1.  1.\n",
      "   1.  1.  1. -1.  1.  1.  1.  1.  1. -1.  1.  1. -1.  1.  1.  1. -1. -1.\n",
      "  -1.  1.  1.  1.  1.  1.  1.  1.  1.  1. -1.]]\n",
      "aggClassEst:  [[ 1.13536197  0.86463803  0.13536197  1.13536197  0.86463803  1.13536197\n",
      "   0.13536197  1.13536197  1.13536197  0.13536197  1.13536197  0.13536197\n",
      "   0.13536197  1.13536197  0.13536197  1.13536197  1.13536197 -0.13536197\n",
      "   0.13536197  1.13536197  1.13536197  0.13536197  0.13536197 -0.13536197\n",
      "   1.13536197 -0.13536197  1.13536197  0.13536197  0.86463803  0.13536197\n",
      "   1.13536197  1.13536197  0.13536197  0.13536197  1.13536197  1.13536197\n",
      "   0.86463803 -0.13536197  0.13536197  0.86463803  1.13536197 -0.13536197\n",
      "   1.13536197  1.13536197  1.13536197  1.13536197  1.13536197  0.13536197\n",
      "   1.13536197  1.13536197  0.13536197  1.13536197  0.13536197 -0.13536197\n",
      "   1.13536197  1.13536197 -0.13536197  1.13536197  1.13536197  1.13536197\n",
      "   0.13536197  0.13536197  1.13536197  1.13536197  1.13536197  1.13536197\n",
      "   0.13536197  0.13536197  1.13536197  0.13536197  1.13536197  0.13536197\n",
      "   0.86463803  1.13536197  0.86463803  1.13536197  0.13536197  0.13536197\n",
      "   1.13536197  1.13536197  1.13536197 -0.13536197  1.13536197  1.13536197\n",
      "   0.13536197  1.13536197  1.13536197  0.86463803  1.13536197  0.13536197\n",
      "  -0.13536197  1.13536197  0.13536197  1.13536197  1.13536197  0.86463803\n",
      "   0.86463803  1.13536197  0.13536197  1.13536197  0.13536197  1.13536197\n",
      "   0.13536197  0.13536197  1.13536197  1.13536197 -0.13536197  0.13536197\n",
      "   1.13536197  1.13536197  1.13536197  0.13536197  0.13536197  0.86463803\n",
      "   1.13536197  0.13536197  0.13536197  1.13536197  0.13536197  0.13536197\n",
      "   0.13536197  0.86463803  0.13536197  1.13536197  1.13536197  0.13536197\n",
      "   1.13536197  0.13536197  0.86463803 -0.13536197  0.86463803  1.13536197\n",
      "   0.13536197  1.13536197  1.13536197  1.13536197  0.13536197  0.13536197\n",
      "   0.13536197  0.13536197  0.86463803  1.13536197  0.13536197  1.13536197\n",
      "   1.13536197  0.13536197  1.13536197  0.86463803 -0.13536197  0.13536197\n",
      "   1.13536197  1.13536197  0.13536197  1.13536197  1.13536197  0.13536197\n",
      "   1.13536197  0.13536197  1.13536197 -0.13536197  0.86463803  0.13536197\n",
      "   1.13536197  1.13536197  0.86463803  0.13536197  0.13536197  1.13536197\n",
      "   0.86463803  0.13536197  1.13536197  1.13536197  1.13536197  1.13536197\n",
      "  -0.13536197  1.13536197  0.86463803  1.13536197  1.13536197  1.13536197\n",
      "  -0.13536197  1.13536197  1.13536197  1.13536197  1.13536197  0.13536197\n",
      "   0.13536197  0.13536197  0.13536197 -0.13536197  0.13536197  0.13536197\n",
      "   1.13536197  0.13536197  0.13536197  1.13536197  1.13536197  0.13536197\n",
      "   1.13536197  1.13536197  1.13536197  0.86463803  0.13536197  1.13536197\n",
      "   1.13536197  1.13536197  0.86463803  1.13536197  0.13536197  0.86463803\n",
      "   1.13536197  1.13536197  1.13536197  0.13536197  0.13536197 -0.13536197\n",
      "  -0.13536197  1.13536197  1.13536197  1.13536197  0.13536197  1.13536197\n",
      "   1.13536197  0.13536197  0.13536197  1.13536197 -0.13536197  1.13536197\n",
      "  -0.13536197  0.13536197  1.13536197 -0.13536197  1.13536197  1.13536197\n",
      "   1.13536197  0.13536197  0.13536197  1.13536197  0.86463803  1.13536197\n",
      "   0.13536197  1.13536197  0.13536197  0.13536197  1.13536197  1.13536197\n",
      "   1.13536197  1.13536197  0.13536197  1.13536197  1.13536197  1.13536197\n",
      "   1.13536197  1.13536197  1.13536197  1.13536197  1.13536197  0.13536197\n",
      "   1.13536197 -0.13536197  0.13536197 -0.13536197  0.86463803  1.13536197\n",
      "   1.13536197  0.13536197  1.13536197 -0.13536197  0.13536197  1.13536197\n",
      "   1.13536197  1.13536197  1.13536197  0.86463803  1.13536197  1.13536197\n",
      "   1.13536197  0.13536197  0.13536197 -0.13536197  1.13536197  1.13536197\n",
      "  -0.13536197  0.13536197  0.13536197  1.13536197 -0.13536197 -0.13536197\n",
      "  -0.13536197  0.13536197  1.13536197  1.13536197  1.13536197  0.13536197\n",
      "   1.13536197  1.13536197  1.13536197  1.13536197  0.86463803]]\n",
      "total error:  0.5016722408026756\n",
      "D:  [[0.00264962 0.00866853 0.00157324 0.00489163 0.00195955 0.0011602\n",
      "  0.00115364 0.00904571 0.00263464 0.00380121 0.00300167 0.002792\n",
      "  0.00085076 0.00967002 0.00138128 0.00263464 0.00141027 0.00224729\n",
      "  0.002792   0.00760406 0.00518379 0.00085076 0.00157324 0.00168426\n",
      "  0.00188368 0.00398821 0.00300167 0.00168183 0.00885975 0.00072396\n",
      "  0.00141027 0.00489163 0.00150983 0.00204734 0.00755715 0.00104002\n",
      "  0.0036608  0.00792177 0.00115364 0.00499231 0.00104002 0.00398821\n",
      "  0.0040703  0.00309609 0.00224729 0.00104002 0.01411812 0.00115364\n",
      "  0.00355057 0.00104002 0.00157324 0.00713123 0.00157324 0.00224729\n",
      "  0.00484199 0.0066331  0.00224729 0.0038409  0.00250278 0.00104002\n",
      "  0.00157324 0.00150983 0.00348333 0.00417244 0.0040703  0.0025543\n",
      "  0.00327325 0.00085076 0.00322081 0.00115364 0.00608735 0.00085076\n",
      "  0.00499231 0.00364866 0.00885975 0.00489163 0.00105542 0.00072396\n",
      "  0.00467565 0.00384655 0.00194294 0.00111527 0.0040703  0.00124207\n",
      "  0.002792   0.0011602  0.00263464 0.00885975 0.00205898 0.00115364\n",
      "  0.00263464 0.00484199 0.00124027 0.00470223 0.00229354 0.00095445\n",
      "  0.00269915 0.00261839 0.00157324 0.00760406 0.00105542 0.00194294\n",
      "  0.00249917 0.00204734 0.00681636 0.00205898 0.00306467 0.00157324\n",
      "  0.00165728 0.00489163 0.00355057 0.00168183 0.00115364 0.00499231\n",
      "  0.00267229 0.00105542 0.00053389 0.00868107 0.00323467 0.00175211\n",
      "  0.00157324 0.00115658 0.00115364 0.0038409  0.01177163 0.00124027\n",
      "  0.00577433 0.00312257 0.00543989 0.00165728 0.00885975 0.00667082\n",
      "  0.00115364 0.00141027 0.00263464 0.00467565 0.00085076 0.00175211\n",
      "  0.00204734 0.00168183 0.00347758 0.00104002 0.00085076 0.00565787\n",
      "  0.00188368 0.00098728 0.01265563 0.00504249 0.00094905 0.00105542\n",
      "  0.00184569 0.00351906 0.00124027 0.00072808 0.00169139 0.00115364\n",
      "  0.01540929 0.00168183 0.0011602  0.00565787 0.00885975 0.00220109\n",
      "  0.0028325  0.00205898 0.00464009 0.00115364 0.00085076 0.00384655\n",
      "  0.00268887 0.00157324 0.00261839 0.00477189 0.00261839 0.00232041\n",
      "  0.00224729 0.0012921  0.00145406 0.00643082 0.00263464 0.00263464\n",
      "  0.00224729 0.00124207 0.0012921  0.0012921  0.00760406 0.00204734\n",
      "  0.00220109 0.00204734 0.00220109 0.00206239 0.00515448 0.00072396\n",
      "  0.00104002 0.002792   0.00105542 0.00517617 0.00357076 0.0012848\n",
      "  0.0040703  0.0011602  0.0038409  0.00885975 0.00085076 0.00425832\n",
      "  0.00263464 0.00325306 0.00885975 0.00565787 0.00124027 0.00543989\n",
      "  0.00489163 0.00205898 0.00169139 0.00150983 0.00085076 0.00224729\n",
      "  0.0074507  0.01265563 0.00169139 0.00264962 0.00187303 0.00560767\n",
      "  0.00205898 0.00115364 0.00085076 0.00261839 0.00224729 0.00141027\n",
      "  0.00197925 0.00751442 0.00104002 0.00224729 0.00300167 0.00229354\n",
      "  0.00364866 0.00115364 0.00157324 0.0066331  0.00469544 0.00104002\n",
      "  0.00157324 0.00681636 0.00204734 0.002792   0.00104002 0.00755715\n",
      "  0.00263464 0.00518379 0.00085076 0.00261839 0.00868107 0.00489163\n",
      "  0.01024758 0.00643082 0.00386274 0.01549691 0.00261839 0.00085076\n",
      "  0.00484199 0.00238937 0.00126422 0.00398821 0.00292994 0.00169139\n",
      "  0.00904571 0.002792   0.00229354 0.00151232 0.00204734 0.00904571\n",
      "  0.00755715 0.00755715 0.00104002 0.0074185  0.0028325  0.01016068\n",
      "  0.0011602  0.00115364 0.00220109 0.00094905 0.00261839 0.00355057\n",
      "  0.00398821 0.00085076 0.00150983 0.00178308 0.00398821 0.00224729\n",
      "  0.00151232 0.00157324 0.00355057 0.0028325  0.0066331  0.00072396\n",
      "  0.00417244 0.00263464 0.00141027 0.00300167 0.00885975]]\n",
      "classEst:  [[-1. -1. -1.  1.  1. -1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1.\n",
      "  -1.  1.  1. -1.  1.  1. -1.  1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.\n",
      "  -1. -1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1.  1.  1. -1.  1. -1. -1.\n",
      "   1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1.  1. -1. -1. -1. -1. -1. -1.\n",
      "  -1. -1. -1. -1. -1. -1. -1. -1.  1. -1.  1. -1.  1.  1.  1. -1.  1. -1.\n",
      "  -1.  1. -1. -1.  1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1.  1.  1.\n",
      "   1.  1. -1. -1. -1. -1. -1.  1. -1. -1.  1. -1.  1.  1. -1. -1. -1.  1.\n",
      "  -1.  1. -1. -1. -1.  1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.  1.\n",
      "   1. -1. -1. -1. -1. -1. -1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1. -1.\n",
      "  -1. -1.  1. -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1.  1.\n",
      "  -1. -1. -1.  1.  1.  1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.\n",
      "   1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.\n",
      "  -1.  1. -1.  1.  1. -1. -1. -1. -1. -1. -1.  1.  1.  1. -1. -1.  1.  1.\n",
      "  -1. -1.  1. -1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1. -1.  1.\n",
      "  -1. -1.  1. -1. -1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1. -1.  1.  1.\n",
      "  -1.  1. -1. -1.  1. -1.  1. -1.  1. -1. -1. -1. -1. -1. -1. -1.  1. -1.\n",
      "   1. -1.  1. -1. -1. -1.  1. -1.  1. -1. -1.]]\n",
      "aggClassEst:  [[ 0.87478413  0.87478413 -0.12521587  1.12521587  1.12521587 -0.12521587\n",
      "  -0.12521587  0.87478413  1.12521587 -0.12521587 -0.12521587  0.12521587\n",
      "  -0.12521587  0.87478413 -0.12521587  1.12521587  1.12521587  0.87478413\n",
      "  -0.12521587  0.12521587  0.12521587 -0.12521587  0.12521587  1.12521587\n",
      "  -0.12521587  1.12521587  0.12521587 -0.12521587  0.87478413 -0.12521587\n",
      "   1.12521587  0.87478413 -0.12521587 -0.12521587  0.12521587  0.87478413\n",
      "   0.87478413  0.87478413 -0.12521587  1.12521587  0.87478413  1.12521587\n",
      "  -0.12521587  0.87478413  0.87478413  0.87478413 -0.12521587 -0.12521587\n",
      "   1.12521587  1.12521587 -0.12521587  1.12521587 -0.12521587  0.87478413\n",
      "   1.12521587  0.87478413  0.87478413  1.12521587  0.87478413  0.87478413\n",
      "   0.12521587 -0.12521587  0.87478413  0.87478413  0.12521587  0.12521587\n",
      "  -0.12521587 -0.12521587 -0.12521587 -0.12521587  0.87478413 -0.12521587\n",
      "   0.87478413  0.87478413  0.87478413  0.87478413 -0.12521587 -0.12521587\n",
      "   0.87478413 -0.12521587  1.12521587  0.87478413  0.12521587  0.87478413\n",
      "   0.12521587  0.12521587  1.12521587  0.87478413  0.12521587 -0.12521587\n",
      "   0.87478413  1.12521587 -0.12521587  0.87478413  0.12521587 -0.12521587\n",
      "   0.12521587  1.12521587  0.12521587  0.12521587 -0.12521587  0.87478413\n",
      "  -0.12521587  0.12521587  0.87478413  0.12521587  1.12521587  0.12521587\n",
      "   1.12521587  1.12521587  0.87478413 -0.12521587 -0.12521587  0.87478413\n",
      "  -0.12521587  0.12521587 -0.12521587  0.87478413  0.12521587 -0.12521587\n",
      "   0.12521587  1.12521587 -0.12521587  0.87478413  0.87478413  0.12521587\n",
      "  -0.12521587  0.12521587  0.87478413  0.87478413  0.87478413  1.12521587\n",
      "  -0.12521587  0.87478413  1.12521587  0.87478413 -0.12521587 -0.12521587\n",
      "   0.12521587 -0.12521587  1.12521587  0.87478413 -0.12521587  1.12521587\n",
      "   0.12521587 -0.12521587  0.87478413 -0.12521587  0.87478413 -0.12521587\n",
      "   0.87478413 -0.12521587 -0.12521587  0.12521587 -0.12521587 -0.12521587\n",
      "   0.87478413  0.12521587 -0.12521587  0.87478413  0.87478413 -0.12521587\n",
      "   0.87478413 -0.12521587  1.12521587 -0.12521587 -0.12521587  0.12521587\n",
      "   0.87478413 -0.12521587  0.87478413  0.12521587  0.87478413  0.87478413\n",
      "   0.87478413  0.12521587  0.87478413  0.12521587  0.87478413  1.12521587\n",
      "   0.87478413  0.87478413 -0.12521587  0.12521587  0.12521587  0.12521587\n",
      "   0.12521587 -0.12521587 -0.12521587  0.87478413  0.12521587 -0.12521587\n",
      "   1.12521587 -0.12521587 -0.12521587  0.87478413  1.12521587 -0.12521587\n",
      "   0.12521587 -0.12521587  0.87478413  1.12521587 -0.12521587 -0.12521587\n",
      "   0.87478413  0.12521587  0.87478413  1.12521587 -0.12521587  0.87478413\n",
      "   0.87478413  0.12521587 -0.12521587  0.12521587 -0.12521587  0.87478413\n",
      "   0.87478413  1.12521587 -0.12521587  1.12521587  0.12521587 -0.12521587\n",
      "  -0.12521587 -0.12521587 -0.12521587  0.87478413  0.87478413  1.12521587\n",
      "   1.12521587  0.12521587  0.87478413  0.87478413  0.12521587  0.12521587\n",
      "   0.87478413 -0.12521587  0.12521587  0.87478413  0.87478413  1.12521587\n",
      "  -0.12521587  1.12521587 -0.12521587  0.12521587  0.87478413  0.12521587\n",
      "   0.87478413  0.12521587 -0.12521587  1.12521587  0.87478413  1.12521587\n",
      "  -0.12521587 -0.12521587  1.12521587  0.87478413  0.87478413 -0.12521587\n",
      "   1.12521587  0.87478413 -0.12521587  0.87478413  1.12521587 -0.12521587\n",
      "   1.12521587 -0.12521587 -0.12521587  0.87478413  0.12521587  1.12521587\n",
      "  -0.12521587  0.12521587  0.87478413  0.87478413  1.12521587  0.87478413\n",
      "   0.12521587 -0.12521587  0.12521587  0.87478413  0.87478413  0.87478413\n",
      "   0.87478413 -0.12521587 -0.12521587  0.87478413  1.12521587  0.87478413\n",
      "   1.12521587 -0.12521587  1.12521587  0.87478413  0.87478413 -0.12521587\n",
      "   1.12521587  0.87478413  1.12521587 -0.12521587  0.87478413]]\n",
      "total error:  0.7224080267558528\n"
     ]
    }
   ],
   "source": [
    "datArr, labelArr = loadDataSet('horseColicTraining2.txt')\n",
    "classifierArray = adaBoostTrainDS(datArr, labelArr, 10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [-0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]\n",
      " [ 0.46166238]]\n",
      "[[ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [ 0.14917993]\n",
      " [-0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [-0.14917993]\n",
      " [-0.77414483]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [-0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [ 0.14917993]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [-0.14917993]\n",
      " [ 0.14917993]\n",
      " [ 0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [-0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.14917993]\n",
      " [-0.14917993]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]\n",
      " [ 0.77414483]]\n",
      "[[ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 0.1376298 ]\n",
      " [-0.43598966]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [-0.1376298 ]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [-0.1376298 ]\n",
      " [-0.1376298 ]\n",
      " [-0.43598966]\n",
      " [-0.43598966]\n",
      " [ 0.4873351 ]\n",
      " [ 0.4873351 ]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [-0.43598966]\n",
      " [-0.43598966]\n",
      " [-1.06095456]\n",
      " [-0.43598966]\n",
      " [ 1.06095456]\n",
      " [-0.43598966]\n",
      " [-1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [-0.1376298 ]\n",
      " [-0.43598966]\n",
      " [ 0.4873351 ]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [-0.1376298 ]\n",
      " [-0.1376298 ]\n",
      " [ 0.4873351 ]\n",
      " [-0.43598966]\n",
      " [ 1.06095456]\n",
      " [ 0.1376298 ]\n",
      " [-0.1376298 ]\n",
      " [-0.1376298 ]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 1.06095456]\n",
      " [ 0.43598966]\n",
      " [ 0.1376298 ]\n",
      " [ 0.4873351 ]\n",
      " [-1.06095456]\n",
      " [ 1.06095456]\n",
      " [-0.1376298 ]\n",
      " [-0.43598966]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]\n",
      " [ 1.06095456]\n",
      " [ 0.4873351 ]]\n",
      "[[ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.37059985]\n",
      " [-0.66895971]\n",
      " [ 0.82798452]\n",
      " [ 0.72030514]\n",
      " [-0.37059985]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [-0.37059985]\n",
      " [-0.37059985]\n",
      " [-0.20301961]\n",
      " [-0.66895971]\n",
      " [ 0.25436505]\n",
      " [ 0.25436505]\n",
      " [ 0.25436505]\n",
      " [ 0.82798452]\n",
      " [-0.66895971]\n",
      " [-0.66895971]\n",
      " [-0.82798452]\n",
      " [-0.66895971]\n",
      " [ 0.82798452]\n",
      " [-0.66895971]\n",
      " [-1.29392461]\n",
      " [ 1.29392461]\n",
      " [ 0.82798452]\n",
      " [ 1.29392461]\n",
      " [ 0.25436505]\n",
      " [ 0.82798452]\n",
      " [ 0.25436505]\n",
      " [ 0.82798452]\n",
      " [-0.37059985]\n",
      " [-0.66895971]\n",
      " [ 0.25436505]\n",
      " [ 0.25436505]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.72030514]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [-0.37059985]\n",
      " [-0.37059985]\n",
      " [ 0.25436505]\n",
      " [-0.66895971]\n",
      " [ 0.82798452]\n",
      " [ 0.37059985]\n",
      " [ 0.09534024]\n",
      " [-0.37059985]\n",
      " [ 0.72030514]\n",
      " [ 1.29392461]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.82798452]\n",
      " [ 0.66895971]\n",
      " [-0.09534024]\n",
      " [ 0.72030514]\n",
      " [-1.29392461]\n",
      " [ 0.82798452]\n",
      " [-0.37059985]\n",
      " [-0.66895971]\n",
      " [ 0.82798452]\n",
      " [ 0.72030514]\n",
      " [ 0.82798452]\n",
      " [ 0.25436505]]\n",
      "[[ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 0.56863831]\n",
      " [-0.47092125]\n",
      " [ 0.62994605]\n",
      " [ 0.91834361]\n",
      " [-0.17256139]\n",
      " [ 0.62994605]\n",
      " [ 1.02602298]\n",
      " [-0.17256139]\n",
      " [-0.17256139]\n",
      " [-0.00498115]\n",
      " [-0.47092125]\n",
      " [ 0.05632659]\n",
      " [ 0.45240351]\n",
      " [ 0.45240351]\n",
      " [ 1.02602298]\n",
      " [-0.47092125]\n",
      " [-0.47092125]\n",
      " [-0.62994605]\n",
      " [-0.47092125]\n",
      " [ 1.02602298]\n",
      " [-0.47092125]\n",
      " [-1.09588615]\n",
      " [ 1.49196307]\n",
      " [ 1.02602298]\n",
      " [ 1.49196307]\n",
      " [ 0.45240351]\n",
      " [ 1.02602298]\n",
      " [ 0.45240351]\n",
      " [ 1.02602298]\n",
      " [-0.17256139]\n",
      " [-0.47092125]\n",
      " [ 0.05632659]\n",
      " [ 0.05632659]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 0.91834361]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [ 1.02602298]\n",
      " [-0.17256139]\n",
      " [-0.56863831]\n",
      " [ 0.45240351]\n",
      " [-0.47092125]\n",
      " [ 1.02602298]\n",
      " [ 0.56863831]\n",
      " [ 0.2933787 ]\n",
      " [-0.17256139]\n",
      " [ 0.91834361]\n",
      " [ 1.49196307]\n",
      " [ 1.02602298]\n",
      " [ 0.62994605]\n",
      " [ 1.02602298]\n",
      " [ 0.86699817]\n",
      " [ 0.10269822]\n",
      " [ 0.91834361]\n",
      " [-1.09588615]\n",
      " [ 1.02602298]\n",
      " [-0.17256139]\n",
      " [-0.47092125]\n",
      " [ 1.02602298]\n",
      " [ 0.91834361]\n",
      " [ 1.02602298]\n",
      " [ 0.45240351]]\n",
      "[[ 1.21450185]\n",
      " [ 1.21450185]\n",
      " [ 0.75711718]\n",
      " [-0.65940012]\n",
      " [ 0.44146718]\n",
      " [ 0.72986473]\n",
      " [-0.36104026]\n",
      " [ 0.81842493]\n",
      " [ 0.8375441 ]\n",
      " [-0.36104026]\n",
      " [-0.36104026]\n",
      " [ 0.18349772]\n",
      " [-0.65940012]\n",
      " [ 0.24480546]\n",
      " [ 0.64088239]\n",
      " [ 0.64088239]\n",
      " [ 0.8375441 ]\n",
      " [-0.28244237]\n",
      " [-0.65940012]\n",
      " [-0.44146718]\n",
      " [-0.65940012]\n",
      " [ 0.8375441 ]\n",
      " [-0.65940012]\n",
      " [-1.28436502]\n",
      " [ 1.68044194]\n",
      " [ 1.21450185]\n",
      " [ 1.68044194]\n",
      " [ 0.64088239]\n",
      " [ 1.21450185]\n",
      " [ 0.64088239]\n",
      " [ 1.21450185]\n",
      " [-0.36104026]\n",
      " [-0.28244237]\n",
      " [ 0.24480546]\n",
      " [-0.13215228]\n",
      " [ 0.8375441 ]\n",
      " [ 1.21450185]\n",
      " [ 1.21450185]\n",
      " [ 1.21450185]\n",
      " [ 0.72986473]\n",
      " [ 0.8375441 ]\n",
      " [ 1.21450185]\n",
      " [ 1.21450185]\n",
      " [-0.36104026]\n",
      " [-0.38015944]\n",
      " [ 0.26392464]\n",
      " [-0.65940012]\n",
      " [ 0.8375441 ]\n",
      " [ 0.38015944]\n",
      " [ 0.10489983]\n",
      " [-0.36104026]\n",
      " [ 1.10682248]\n",
      " [ 1.68044194]\n",
      " [ 1.21450185]\n",
      " [ 0.81842493]\n",
      " [ 0.8375441 ]\n",
      " [ 0.6785193 ]\n",
      " [-0.08578066]\n",
      " [ 1.10682248]\n",
      " [-0.90740727]\n",
      " [ 0.8375441 ]\n",
      " [-0.36104026]\n",
      " [-0.28244237]\n",
      " [ 1.21450185]\n",
      " [ 1.10682248]\n",
      " [ 0.8375441 ]\n",
      " [ 0.26392464]]\n",
      "[[ 1.36677554]\n",
      " [ 1.06222816]\n",
      " [ 0.60484349]\n",
      " [-0.81167381]\n",
      " [ 0.28919349]\n",
      " [ 0.88213842]\n",
      " [-0.20876657]\n",
      " [ 0.97069862]\n",
      " [ 0.98981779]\n",
      " [-0.51331395]\n",
      " [-0.20876657]\n",
      " [ 0.03122403]\n",
      " [-0.50712643]\n",
      " [ 0.39707915]\n",
      " [ 0.79315608]\n",
      " [ 0.79315608]\n",
      " [ 0.68527041]\n",
      " [-0.43471606]\n",
      " [-0.81167381]\n",
      " [-0.59374087]\n",
      " [-0.50712643]\n",
      " [ 0.98981779]\n",
      " [-0.50712643]\n",
      " [-1.43663871]\n",
      " [ 1.52816825]\n",
      " [ 1.06222816]\n",
      " [ 1.83271563]\n",
      " [ 0.4886087 ]\n",
      " [ 1.06222816]\n",
      " [ 0.4886087 ]\n",
      " [ 1.36677554]\n",
      " [-0.20876657]\n",
      " [-0.43471606]\n",
      " [ 0.09253177]\n",
      " [-0.28442597]\n",
      " [ 0.68527041]\n",
      " [ 1.06222816]\n",
      " [ 1.06222816]\n",
      " [ 1.06222816]\n",
      " [ 0.88213842]\n",
      " [ 0.98981779]\n",
      " [ 1.36677554]\n",
      " [ 1.06222816]\n",
      " [-0.51331395]\n",
      " [-0.53243313]\n",
      " [ 0.11165095]\n",
      " [-0.50712643]\n",
      " [ 0.68527041]\n",
      " [ 0.22788575]\n",
      " [-0.04737386]\n",
      " [-0.51331395]\n",
      " [ 0.95454879]\n",
      " [ 1.52816825]\n",
      " [ 1.06222816]\n",
      " [ 0.66615124]\n",
      " [ 0.98981779]\n",
      " [ 0.52624561]\n",
      " [-0.23805435]\n",
      " [ 1.25909617]\n",
      " [-1.05968096]\n",
      " [ 0.98981779]\n",
      " [-0.51331395]\n",
      " [-0.43471606]\n",
      " [ 1.06222816]\n",
      " [ 0.95454879]\n",
      " [ 0.68527041]\n",
      " [ 0.11165095]]\n",
      "[[ 1.21166683]\n",
      " [ 1.21733687]\n",
      " [ 0.44973479]\n",
      " [-0.96678252]\n",
      " [ 0.13408478]\n",
      " [ 1.03724713]\n",
      " [-0.36387528]\n",
      " [ 0.81558991]\n",
      " [ 0.83470909]\n",
      " [-0.66842266]\n",
      " [-0.36387528]\n",
      " [-0.12388468]\n",
      " [-0.66223514]\n",
      " [ 0.24197045]\n",
      " [ 0.63804737]\n",
      " [ 0.94826478]\n",
      " [ 0.84037912]\n",
      " [-0.58982477]\n",
      " [-0.96678252]\n",
      " [-0.74884958]\n",
      " [-0.66223514]\n",
      " [ 0.83470909]\n",
      " [-0.66223514]\n",
      " [-1.59174742]\n",
      " [ 1.68327696]\n",
      " [ 0.90711945]\n",
      " [ 1.67760692]\n",
      " [ 0.33349999]\n",
      " [ 1.21733687]\n",
      " [ 0.6437174 ]\n",
      " [ 1.52188425]\n",
      " [-0.36387528]\n",
      " [-0.58982477]\n",
      " [-0.06257693]\n",
      " [-0.43953468]\n",
      " [ 0.84037912]\n",
      " [ 1.21733687]\n",
      " [ 1.21733687]\n",
      " [ 0.90711945]\n",
      " [ 0.72702971]\n",
      " [ 0.83470909]\n",
      " [ 1.21166683]\n",
      " [ 0.90711945]\n",
      " [-0.66842266]\n",
      " [-0.68754184]\n",
      " [-0.04345776]\n",
      " [-0.66223514]\n",
      " [ 0.84037912]\n",
      " [ 0.38299446]\n",
      " [-0.20248257]\n",
      " [-0.66842266]\n",
      " [ 0.79944008]\n",
      " [ 1.37305954]\n",
      " [ 1.21733687]\n",
      " [ 0.82125995]\n",
      " [ 1.1449265 ]\n",
      " [ 0.68135431]\n",
      " [-0.39316305]\n",
      " [ 1.10398746]\n",
      " [-1.21478967]\n",
      " [ 1.1449265 ]\n",
      " [-0.66842266]\n",
      " [-0.58982477]\n",
      " [ 1.21733687]\n",
      " [ 0.79944008]\n",
      " [ 0.53016171]\n",
      " [ 0.26675966]]\n",
      "[[ 1.07630486]\n",
      " [ 1.0819749 ]\n",
      " [ 0.31437281]\n",
      " [-0.83142054]\n",
      " [ 0.26944676]\n",
      " [ 1.1726091 ]\n",
      " [-0.22851331]\n",
      " [ 0.95095188]\n",
      " [ 0.97007106]\n",
      " [-0.53306069]\n",
      " [-0.22851331]\n",
      " [-0.25924665]\n",
      " [-0.52687316]\n",
      " [ 0.37733242]\n",
      " [ 0.77340934]\n",
      " [ 1.08362676]\n",
      " [ 0.9757411 ]\n",
      " [-0.4544628 ]\n",
      " [-0.83142054]\n",
      " [-0.88421155]\n",
      " [-0.52687316]\n",
      " [ 0.97007106]\n",
      " [-0.52687316]\n",
      " [-1.45638544]\n",
      " [ 1.81863893]\n",
      " [ 1.04248143]\n",
      " [ 1.8129689 ]\n",
      " [ 0.46886196]\n",
      " [ 1.35269884]\n",
      " [ 0.50835543]\n",
      " [ 1.65724622]\n",
      " [-0.22851331]\n",
      " [-0.4544628 ]\n",
      " [-0.19793891]\n",
      " [-0.30417271]\n",
      " [ 0.9757411 ]\n",
      " [ 1.35269884]\n",
      " [ 1.35269884]\n",
      " [ 1.04248143]\n",
      " [ 0.86239169]\n",
      " [ 0.97007106]\n",
      " [ 1.34702881]\n",
      " [ 1.04248143]\n",
      " [-0.53306069]\n",
      " [-0.55217986]\n",
      " [ 0.09190421]\n",
      " [-0.52687316]\n",
      " [ 0.9757411 ]\n",
      " [ 0.51835643]\n",
      " [-0.06712059]\n",
      " [-0.53306069]\n",
      " [ 0.93480205]\n",
      " [ 1.50842152]\n",
      " [ 1.35269884]\n",
      " [ 0.68589797]\n",
      " [ 1.28028848]\n",
      " [ 0.81671629]\n",
      " [-0.25780108]\n",
      " [ 1.23934943]\n",
      " [-1.0794277 ]\n",
      " [ 1.28028848]\n",
      " [-0.53306069]\n",
      " [-0.4544628 ]\n",
      " [ 1.35269884]\n",
      " [ 0.93480205]\n",
      " [ 0.66552368]\n",
      " [ 0.40212163]]\n",
      "[[ 0.95108899]\n",
      " [ 1.20719077]\n",
      " [ 0.18915694]\n",
      " [-0.95663642]\n",
      " [ 0.14423088]\n",
      " [ 1.29782498]\n",
      " [-0.10329743]\n",
      " [ 0.82573601]\n",
      " [ 1.09528693]\n",
      " [-0.65827656]\n",
      " [-0.35372918]\n",
      " [-0.38446252]\n",
      " [-0.40165729]\n",
      " [ 0.50254829]\n",
      " [ 0.64819347]\n",
      " [ 1.20884263]\n",
      " [ 0.85052522]\n",
      " [-0.57967867]\n",
      " [-0.70620467]\n",
      " [-0.75899568]\n",
      " [-0.65208904]\n",
      " [ 1.09528693]\n",
      " [-0.40165729]\n",
      " [-1.33116957]\n",
      " [ 1.69342306]\n",
      " [ 1.1676973 ]\n",
      " [ 1.68775303]\n",
      " [ 0.34364609]\n",
      " [ 1.22748297]\n",
      " [ 0.38313956]\n",
      " [ 1.53203035]\n",
      " [-0.35372918]\n",
      " [-0.57967867]\n",
      " [-0.32315478]\n",
      " [-0.17895684]\n",
      " [ 0.85052522]\n",
      " [ 1.22748297]\n",
      " [ 1.22748297]\n",
      " [ 0.91726555]\n",
      " [ 0.98760756]\n",
      " [ 0.84485519]\n",
      " [ 1.47224468]\n",
      " [ 0.91726555]\n",
      " [-0.65827656]\n",
      " [-0.67739574]\n",
      " [ 0.21712009]\n",
      " [-0.40165729]\n",
      " [ 0.85052522]\n",
      " [ 0.39314056]\n",
      " [ 0.05809528]\n",
      " [-0.40784481]\n",
      " [ 0.80958618]\n",
      " [ 1.63363739]\n",
      " [ 1.22748297]\n",
      " [ 0.81111385]\n",
      " [ 1.1550726 ]\n",
      " [ 0.69150041]\n",
      " [-0.38301695]\n",
      " [ 1.11413356]\n",
      " [-1.20464357]\n",
      " [ 1.1550726 ]\n",
      " [-0.40784481]\n",
      " [-0.32924692]\n",
      " [ 1.47791472]\n",
      " [ 0.80958618]\n",
      " [ 0.54030781]\n",
      " [ 0.5273375 ]]\n"
     ]
    }
   ],
   "source": [
    "testArr, testLabelArr = loadDataSet('horseColicTest2.txt')\n",
    "prediction10 = adaClassify(testArr, classifierArray)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16.0"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "errArr = mat(ones((67, 1)))\n",
    "errArr[prediction10 != mat(testLabelArr).T].sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# ROC曲线的绘制及AUC计算"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 参数：分类器的预测强度（累计权值值），标签\n",
    "def plotROC(predStrengths, classLabels):\n",
    "    import matplotlib.pyplot as plt\n",
    "    cur = (1.0, 1.0)\n",
    "    ySum = 0.0  # 高度的和\n",
    "    numPosClas = sum(array(classLabels) == 1.0)  # 分类为1的个数\n",
    "    yStep = 1 / float(numPosClas)\n",
    "    xStep = 1 / float(len(classLabels) - numPosClas)  # 矩阵宽度\n",
    "    sortedIndicies = predStrengths.argsort()  # argsort函数返回的是数组值从小到大的索引值\n",
    "    \n",
    "    fig = plt.figure()\n",
    "    fig.clf()\n",
    "    ax = plt.subplot(111)\n",
    "    for index in sortedIndicies.tolist()[0]:  # 将数组或者矩阵转换成列表\n",
    "        if classLabels[index] == 1.0:\n",
    "            delX = 0\n",
    "            delY = yStep\n",
    "        else:\n",
    "            delX = xStep\n",
    "            delY = 0\n",
    "            ySum += cur[1]\n",
    "        ax.plot([cur[0], cur[0]-delX], [cur[1], cur[1]-delY], c='b')\n",
    "        cur = (cur[0] - delX, cur[1] - delY)\n",
    "        \n",
    "    ax.plot([0, 1], [0, 1], 'b--')  # 绘制虚线，起始点是[0,0]到[1,1]\n",
    "    \n",
    "    plt.xlabel('False Positive Rate')\n",
    "    plt.ylabel('True Positive Rate')\n",
    "    plt.title('ROC curve for AdaBoost Horse Colic Detection System')\n",
    "    ax.axis([0, 1, 0, 1])  # 横坐标范围0~1，纵坐标范围0~1\n",
    "    plt.show()\n",
    "    \n",
    "    print('the Area Under the Curve is: ', ySum * xStep)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 只修改了最后一行代码\n",
    "def adaBoostTrainDS(dataArr, classLabels, numIt=40):\n",
    "    weakClassArr = []\n",
    "    m = shape(dataArr)[0]\n",
    "    D = mat(ones((m, 1)) / m)  # 初始概率相等\n",
    "    aggClassEst = mat(zeros((m, 1)))  # 记录每个数据点的类别估计累计值\n",
    "    for i in range(numIt):\n",
    "        bestStump, error, classEst = buildStump(dataArr, classLabels, D)\n",
    "        \n",
    "        alpha = float(0.5 * log((1.0 - error) / max(error, 1e-16))) # 更新权重值\n",
    "        bestStump['alpha'] = alpha\n",
    "        \n",
    "        weakClassArr.append(bestStump)\n",
    "        \n",
    "        # 更新概率\n",
    "        expon = multiply(-1 * alpha * mat(classLabels).T, classEst)\n",
    "        D = multiply(D, exp(expon))\n",
    "        D = D / D.sum()\n",
    "        \n",
    "        aggClassEst += alpha * classEst\n",
    "        \n",
    "        # sign：正数返回1，负数返回-1，0返回0\n",
    "        # 最后乘以1是为了将布尔转换为数字，multiply是对应位置相乘\n",
    "        aggClassEst = multiply(sign(aggClassEst) != mat(classLabels).T, ones((m, 1)))\n",
    "        errorRate = aggClassEst.sum() / m\n",
    "        \n",
    "        if errorRate == 0.0:\n",
    "            break\n",
    "    return weakClassArr, aggClassEst"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEWCAYAAAB42tAoAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAgAElEQVR4nO3dd7wU5fXH8c8RRKQoFowBbAlERQUELMEeY8EaS2wEe+w9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GRxvZqsSGWo3cvd+wM/TT3b3e4HRxC//Ae7+Werhe4F9U8sHAvc0s5y7Aun0JOcnV+T3A7Yzs37ufjWRy2cHd9/BzFYHLgC+mxzL0cAZjbyOtHFVmcJD2rzPkpNl2vLANUmb/GIihXa2l4DzzawXMQ/DO2a2I5FBdVSS3mRF8s9TcZeZfQZMIea0WB94N5U/6zbgRCJl9ULgZjN7BHi42B1z91lmNjnJs/NO8hovJNttSjk7E+kq0jOUHWBmxxDf668DfYn0HWlbJve/kLxOB+K4ieSlQCG14nTgQyL76XLEiXop7v5HM/sXsDvwuJkdTeT1uc3dzy3iNYa5++jMgpmtlmulJLfQ5kSSuYOAk4j01cW6BzgA+A9wv7u7xVm76HISs7hdClwL7Gtm6wFnApu5+xwzuxXomOO5Bjzp7gc3obzSxqnpSWrFysDMZLKZ4cSv6aWY2TeAyUlzy0NEE8w/gP3NbI1knVXNbJ0iX/M/wLpm1jtZHg48m7Tpr+zujxIdxblGHn0KdM2z3fuA7wEHE0GDppbT3b8kmpC2TJqtVgLmA59YZEcdmqcsLwNbZfbJzDqZWa7amchXFCikVlwHHGZmLxPNTvNzrHMgMM7MXiPmGrg9GWl0AfCEmb0BPEk0yzTK3RcS2TX/kmQdXULMnNcVeDjZ3rNEbSfbrcANmc7srO3OIeayXsfdX0nua3I5k76PXwNnuvvrwBhgPHAL0ZyVcRPwdzN7xt1nESOy/pS8zsvEsRLJS9ljRUSkINUoRESkIAUKEREpSIFCREQKUqAQEZGCFChERKQgBQoRESlIgUJERAr6f7hcg0CHEwJIAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "the Area Under the Curve is:  0.3517968242176601\n"
     ]
    }
   ],
   "source": [
    "datArr, labelArr = loadDataSet('horseColicTraining2.txt')\n",
    "classifierArray, aggClassEst = adaBoostTrainDS(datArr, labelArr, 40)\n",
    "plotROC(aggClassEst.T, labelArr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
